diff options
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r-- | bash/bashrc.d/git.bash | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bash/bashrc.d/git.bash b/bash/bashrc.d/git.bash index 7e0b2028..1f0a78ed 100644 --- a/bash/bashrc.d/git.bash +++ b/bash/bashrc.d/git.bash @@ -10,7 +10,8 @@ _git() { # If the first word is appropriate, complete with branch/tag names checkout|merge|rebase) local branch - while read -r branch ; do + while read -r _ _ branch ; do + branch=${branch##*/} [[ $branch == "${COMP_WORDS[COMP_CWORD]}"* ]] || continue COMPREPLY=("${COMPREPLY[@]}" "$branch") done < <(git for-each-ref refs/{heads,tags} 2>/dev/null) |