diff options
Diffstat (limited to 'bash/bash_completion.d/git.bash')
-rw-r--r-- | bash/bash_completion.d/git.bash | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bash/bash_completion.d/git.bash b/bash/bash_completion.d/git.bash index 28313f76..a2edb468 100644 --- a/bash/bash_completion.d/git.bash +++ b/bash/bash_completion.d/git.bash @@ -12,9 +12,9 @@ _git() { refs) local ref while IFS= read -r ref ; do - [[ -n $ref ]] || continue ref=${ref#refs/*/} case $ref in + '') continue ;; "${COMP_WORDS[COMP_CWORD]}"*) COMPREPLY[${#COMPREPLY[@]}]=$ref ;; @@ -59,7 +59,8 @@ _git() { execpath=$(git --exec-path) || return local path for path in "$execpath"/git-"${COMP_WORDS[COMP_CWORD]}"* ; do - [[ -f $path ]] || continue + ! [[ -d $path ]] || continue + [[ -e $path ]] || continue [[ -x $path ]] || continue COMPREPLY[${#COMPREPLY[@]}]=${path#"$execpath"/git-} done |