]> git.ipfire.org Git - thirdparty/git.git/commitdiff
completion: fix conflict with bashcomp
authorFelipe Contreras <felipe.contreras@gmail.com>
Wed, 28 Oct 2020 02:06:55 +0000 (20:06 -0600)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Oct 2020 21:30:59 +0000 (14:30 -0700)
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>
contrib/completion/git-completion.zsh

index e5670625052b07cdd64401bd7fdfb43460856e26..b894cb52db49baba9798a98335596eab9d772343 100644 (file)
 #  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 ()
 {