Skip to content

Commit 926eb7b

Browse files
moygitster
authored andcommitted
git-completion.zsh: define __gitcomp_file compatibility function
Commit fea16b4 (Fri Jan 11 19:48:43 2013, Manlio Perillo, git-completion.bash: add support for path completion), introduced a new __gitcomp_file function that uses the bash builtin "compgen". The function was redefined for ZSH in the deprecated section of git-completion.bash, but not in the new git-completion.zsh script. As a result, users of git-completion.zsh trying to complete "git add fo<tab>" get an error: git add fo__gitcomp_file:8: command not found: compgen This patch adds the redefinition and removes the error. Signed-off-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fea16b4 commit 926eb7b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

contrib/completion/git-completion.zsh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@ __gitcomp_nl ()
6060
compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0
6161
}
6262

63+
__gitcomp_file ()
64+
{
65+
emulate -L zsh
66+
67+
local IFS=$'\n'
68+
compset -P '*[=:]'
69+
compadd -Q -p "${2-}" -f -- ${=1} && _ret=0
70+
}
71+
6372
_git ()
6473
{
6574
local _ret=1

0 commit comments

Comments
 (0)