Browse Source

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>
maint
Ramkumar Ramachandra 11 years ago committed by Junio C Hamano
parent
commit
d028b8906a
  1. 2
      contrib/completion/git-completion.zsh

2
contrib/completion/git-completion.zsh

@ -30,10 +30,10 @@ if [ -z "$script" ]; then @@ -30,10 +30,10 @@ if [ -z "$script" ]; then
local -a locations
local e
locations=(
$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
'/etc/bash_completion.d/git' # fedora, old debian
'/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian
'/usr/share/bash-completion/git' # gentoo
$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
)
for e in $locations; do
test -f $e && script="$e" && break

Loading…
Cancel
Save