Merge branch 'jk/complete-commit-c'
[gitweb.git] / contrib / completion / git-completion.bash
index 98f390ae46a6359d3a9d5f42fc2cce2186efd242..a4c48e179eb778077462a812b491e762e284486c 100644 (file)
@@ -958,6 +958,8 @@ _git_clone ()
                        --upload-pack
                        --template=
                        --depth
+                       --single-branch
+                       --branch
                        "
                return
                ;;
@@ -969,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
@@ -2402,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