Skip to content

Commit

Permalink
completion: fix conflict with bashcomp
Browse files Browse the repository at this point in the history
We don't want to override the 'complete()' function in zsh, which can be
used by bashcomp.

Reported-by: Mark Lodato <[email protected]>
Signed-off-by: Felipe Contreras <[email protected]>
  • Loading branch information
felipec committed Oct 27, 2020
1 parent fb9a0f5 commit d7c7498
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions git-completion.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -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 ()
{
Expand Down

0 comments on commit d7c7498

Please sign in to comment.