Skip to content

Commit

Permalink
bash: complete *_HEAD refs if present
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ian Ward Comfort authored and Junio C Hamano committed Mar 17, 2010
1 parent 7325283 commit d23e757
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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"
;;
Expand Down

0 comments on commit d23e757

Please sign in to comment.