completion: fix conflict with bashcomp

We don't want to override the 'complete()' function in zsh, which can be
used by bashcomp.

Reported-by: Mark Lodato <lodato@google.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Felipe Contreras 2020-10-27 20:06:55 -06:00 committed by Junio C Hamano
parent aa1f1f8010
commit 3791968bfe
1 changed files with 4 additions and 6 deletions

View File

@ -21,12 +21,6 @@
# zstyle ':completion:*:*:git:*' script ~/.git-completion.bash
#

complete ()
{
# do nothing
return 0
}

zstyle -T ':completion:*:*:git:*' tag-order && \
zstyle ':completion:*:*:git:*' tag-order 'common-commands'

@ -48,7 +42,11 @@ if [ -z "$script" ]; then
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 ()
{