From: Ian Ward Comfort Date: Wed, 17 Mar 2010 09:20:35 +0000 (-0700) Subject: bash: complete *_HEAD refs if present X-Git-Tag: v1.7.0.3~11 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=d23e7570a764d5e3fd033b7586bb4924d2774370;p=git-core%2Fgit.git bash: complete *_HEAD refs if present We already complete HEAD, of course, and might as well complete the other common refs mentioned in the rev-parse man page: FETCH_HEAD, ORIG_HEAD, and MERGE_HEAD. Signed-off-by: Ian Ward Comfort Acked-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index fe93747c9..733ac39a3 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -250,7 +250,9 @@ __git_refs () refs="${cur%/*}" ;; *) - if [ -e "$dir/HEAD" ]; then echo HEAD; fi + for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do + if [ -e "$dir/$i" ]; then echo $i; fi + done format="refname:short" refs="refs/tags refs/heads refs/remotes" ;;