Git tab completion stopped working on remote branches

I've been looking into this for the last few hours and have identified the regression.

The regression occurs in 6880779.

To temporarily resolve this: replace your git-completion.bash file (mine's located at /usr/local/share/zsh/site-functions/git-completion.bash) with https://github.com/git/git/blob/688077910bdfbd502cb59c9c48a2af2c97d8b67b~1/contrib/completion/git-completion.bash

To really resolve this, upvote my git PR and help get it merged! (https://github.com/git/git/pull/902)


Try the following patch:

--- a/git-completion.zsh
+++ b/git-completion.zsh
@@ -97,6 +97,11 @@ __gitcomp_direct ()
        compadd -Q -S '' -- ${(f)1} && _ret=0
 }
 
+__gitcomp_direct_append ()
+{
+       __gitcomp_direct "$@"
+}
+
 __gitcomp_nl ()
 {
        emulate -L zsh

In general it's better to report bugs to the git mailing list, however, I'm the maintainer of the zsh code, which is more up to date in my fork: git-completion.