@matheusbsbs / matheus-bagliano / commits / d23e7570a7
Fork 0

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 <icomfort@stanford.edu> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ian Ward Comfort committed Mar 17, 2010 at 02:20 UTC d23e7570a764d5e3fd033b7586bb4924d2774370
1 file changed +3 -1
contrib/completion/git-completion.bash
+3 -1
@@ -250,7 +250,9 @@ __git_refs ()
250 refs="${cur%/*}"
251 ;;
252 *)
253 - if [ -e "$dir/HEAD" ]; then echo HEAD; fi
253 + for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do
254 + if [ -e "$dir/$i" ]; then echo $i; fi
255 + done
256 format="refname:short"
257 refs="refs/tags refs/heads refs/remotes"
258 ;;