diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2015-10-21 14:09:47 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2015-10-21 14:09:47 +1300 |
commit | 78a551f7d24d46560138bf8b846c35f0443f6a0b (patch) | |
tree | 3a56f7392eefb18e1caa555df668df25a9a6ae31 /bash/bashrc.d | |
parent | Change COMP_REPLY to intended COMP_WORDS (diff) | |
download | dotfiles-78a551f7d24d46560138bf8b846c35f0443f6a0b.tar.gz dotfiles-78a551f7d24d46560138bf8b846c35f0443f6a0b.zip |
Correct enumeration of git refs in completion
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) |