@@ -3474,7 +3474,6 @@ __git_func_wrap ()
# This is NOT a public function; use at your own risk.
__git_complete ()
{
- test -n "$ZSH_VERSION" && return
local wrapper="__git_wrap${2}"
eval "$wrapper () { __git_func_wrap $2 ; }"
complete -o bashdefault -o default -o nospace -F $wrapper $1 2>/dev/null \
@@ -27,19 +27,26 @@ zstyle -T ':completion:*:*:git:*' tag-order && \
zstyle -s ":completion:*:*:git:*" script script
if [ -z "$script" ]; then
local -a locations
- local e
+ local e bash_completion
+
+ bash_completion=$(pkg-config --variable=completionsdir bash-completion 2>/dev/null) ||
+ bash_completion='/usr/share/bash-completion/completions/'
+
locations=(
"$(dirname ${funcsourcetrace[1]%:*})"/git-completion.bash
"$HOME/.local/share/bash-completion/completions/git"
- "$(pkg-config --variable=completionsdir bash-completion)"/git
- '/usr/share/bash-completion/completions/git'
+ "$bash_completion/git"
'/etc/bash_completion.d/git' # old debian
)
for e in $locations; do
test -f $e && script="$e" && break
done
fi
+
+local old_complete="$functions[complete]"
+functions[complete]=:
GIT_SOURCING_ZSH_COMPLETION=y . "$script"
+functions[complete]="$old_complete"
__gitcomp ()
{
@@ -129,7 +136,7 @@ __gitcomp_file_direct ()
_git_zsh ()
{
- __gitcomp "v1.0"
+ __gitcomp "v1.1"
}
__git_complete_command ()