diff options
Diffstat (limited to 'bash')
-rw-r--r-- | bash/bash_completion.d/git.bash | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bash/bash_completion.d/git.bash b/bash/bash_completion.d/git.bash index 450160fc..ea5e00cd 100644 --- a/bash/bash_completion.d/git.bash +++ b/bash/bash_completion.d/git.bash @@ -15,7 +15,10 @@ _git() { 98) local ci while read -r _ ref ; do - COMPREPLY[ci++]=${ref#refs/heads/} + branch=${ref#refs/heads/} + case $branch in + "$2"*) COMPREPLY[ci++]=$branch ;; + esac done < <(git show-ref --heads) ;; @@ -23,7 +26,10 @@ _git() { 116) local ci while read -r _ ref ; do - COMPREPLY[ci++]=${ref#refs/tags/} + tag=${ref#refs/tags/} + case $tag in + "$2"*) COMPREPLY[ci++]=$tag ;; + esac done < <(git show-ref --tags) ;; |