From 78a551f7d24d46560138bf8b846c35f0443f6a0b Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 21 Oct 2015 14:09:47 +1300 Subject: Correct enumeration of git refs in completion --- bash/bashrc.d/git.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bash/bashrc.d') 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) -- cgit v1.2.3