Merge branch 'zk/clean-report-failure'
[gitweb.git] / contrib / completion / git-completion.bash
index af13fcc440876f4b851724050548e399a4b90d31..14dd5e7ca272350b3fa13d6fc8da3ccb46e12227 100644 (file)
@@ -397,7 +397,7 @@ __git_complete_revlist_file ()
                *)   pfx="$ref:$pfx" ;;
                esac
 
-               __gitcomp_nl "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \
+               __gitcomp_nl "$(git --git-dir="$(__gitdir)" ls-tree "$ls" 2>/dev/null \
                                | sed '/^100... blob /{
                                           s,^.*        ,,
                                           s,$, ,
@@ -971,6 +971,13 @@ _git_commit ()
 {
        __git_has_doubledash && return
 
+       case "$prev" in
+       -c|-C)
+               __gitcomp_nl "$(__git_refs)" "" "${cur}"
+               return
+               ;;
+       esac
+
        case "$cur" in
        --cleanup=*)
                __gitcomp "default strip verbatim whitespace
@@ -2404,6 +2411,8 @@ __gitk_main ()
 if [[ -n ${ZSH_VERSION-} ]]; then
        echo "WARNING: this script is deprecated, please see git-completion.zsh" 1>&2
 
+       autoload -U +X compinit && compinit
+
        __gitcomp ()
        {
                emulate -L zsh