Imported Upstream version 2.21.0
[platform/upstream/git.git] / contrib / completion / git-completion.zsh
index e255413..886bf95 100644 (file)
@@ -39,7 +39,7 @@ if [ -z "$script" ]; then
                test -f $e && script="$e" && break
        done
 fi
-ZSH_VERSION='' . "$script"
+GIT_SOURCING_ZSH_COMPLETION=y . "$script"
 
 __gitcomp ()
 {
@@ -67,6 +67,15 @@ __gitcomp ()
        esac
 }
 
+__gitcomp_direct ()
+{
+       emulate -L zsh
+
+       local IFS=$'\n'
+       compset -P '*[=:]'
+       compadd -Q -- ${=1} && _ret=0
+}
+
 __gitcomp_nl ()
 {
        emulate -L zsh
@@ -84,13 +93,22 @@ __gitcomp_nl_append ()
        compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0
 }
 
+__gitcomp_file_direct ()
+{
+       emulate -L zsh
+
+       local IFS=$'\n'
+       compset -P '*[=:]'
+       compadd -f -- ${=1} && _ret=0
+}
+
 __gitcomp_file ()
 {
        emulate -L zsh
 
        local IFS=$'\n'
        compset -P '*[=:]'
-       compadd -Q -p "${2-}" -f -- ${=1} && _ret=0
+       compadd -p "${2-}" -f -- ${=1} && _ret=0
 }
 
 __git_zsh_bash_func ()