Skip to content

Commit

Permalink
completion: zsh: fix loading
Browse files Browse the repository at this point in the history
We need to load bashcominit, otherwise complete() isn't available.

  __git_complete:5: command not found: complete

Signed-off-by: Felipe Contreras <[email protected]>
  • Loading branch information
felipec committed Nov 3, 2020
1 parent e0fc1f4 commit 604f80f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
7 changes: 0 additions & 7 deletions contrib/tig-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,6 @@ _tig() {
esac
}

# Detect if current shell is ZSH, and if so, load this file in bash
# compatibility mode.
if [ -n "$ZSH_VERSION" ]; then
autoload bashcompinit
bashcompinit
fi

# we use internal git-completion functions, so wrap _tig for all necessary
# variables (like cword and prev) to be defined
__git_complete tig _tig
Expand Down
1 change: 1 addition & 0 deletions contrib/tig-completion.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

_tig () {
local e
autoload -U bashcompinit && bashcompinit
e=$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
if [ -f $e ]; then
GIT_SOURCING_ZSH_COMPLETION=y . $e
Expand Down

0 comments on commit 604f80f

Please sign in to comment.