completion: remove credential helpers from porcelain commands
[gitweb.git] / contrib / completion / git-completion.bash
index 5d608a125bbbd1330692ba4c11ed1295e6950ad2..b687d7e8d5c73f3ffa148c2cbc88e02777206230 100755 (executable)
@@ -676,9 +676,7 @@ __git_complete_revlist_file ()
                *)   pfx="$ref:$pfx" ;;
                esac
 
-               local IFS=$'\n'
-               COMPREPLY=($(compgen -P "$pfx" \
-                       -W "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \
+               __gitcomp_nl "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \
                                | sed '/^100... blob /{
                                           s,^.*        ,,
                                           s,$, ,
@@ -692,7 +690,7 @@ __git_complete_revlist_file ()
                                           s,$,/,
                                       }
                                       s/^.*    //')" \
-                       -- "$cur_"))
+                       "$pfx" "$cur_" ""
                ;;
        *...*)
                pfx="${cur_%...*}..."
@@ -848,6 +846,8 @@ __git_list_porcelain_commands ()
                checkout-index)   : plumbing;;
                commit-tree)      : plumbing;;
                count-objects)    : infrequent;;
+               credential-cache) : credentials helper;;
+               credential-store) : credentials helper;;
                cvsexportcommit)  : export;;
                cvsimport)        : import;;
                cvsserver)        : daemon;;
@@ -2702,6 +2702,18 @@ __git_complete ()
                || complete -o default -o nospace -F $wrapper $1
 }
 
+# wrapper for backwards compatibility
+_git ()
+{
+       __git_wrap_main_git
+}
+
+# wrapper for backwards compatibility
+_gitk ()
+{
+       __git_wrap_main_gitk
+}
+
 __git_complete git _main_git
 __git_complete gitk _main_gitk