zsh completion: find matching custom bash completion

If zsh completion is being read from a location that is different from system-wide default, it is likely that the user is trying to use a custom version, perhaps closer to the bleeding edge, installed in her own directory. We will more likely to find the matching bash completion script in the same directory than in those system default places. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ramkumar Ramachandra committed Jan 5, 2014 at 15:48 UTC d028b8906afb5b8c24c9449f26e5f930750d8df7
1 file changed +1 -1
contrib/completion/git-completion.zsh
+1 -1
@@ -30,10 +30,10 @@ if [ -z "$script" ]; then
30 local -a locations
31 local e
32 locations=(
33 + $(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
34 '/etc/bash_completion.d/git' # fedora, old debian
35 '/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian
36 '/usr/share/bash-completion/git' # gentoo
36 - $(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
37 )
38 for e in $locations; do
39 test -f $e && script="$e" && break