aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Ward Comfort <icomfort@stanford.edu>2010-03-17 02:20:35 -0700
committerJunio C Hamano <gitster@pobox.com>2010-03-17 11:03:44 -0700
commitd23e7570a764d5e3fd033b7586bb4924d2774370 (patch)
tree12c374ddbde761eb2adf49e59dbdc3a5b3462b26
parent7325283987430f94712713313c5089e5143f2e17 (diff)
downloadgit-d23e7570a764d5e3fd033b7586bb4924d2774370.tar.gz
git-d23e7570a764d5e3fd033b7586bb4924d2774370.tar.xz
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>
-rwxr-xr-xcontrib/completion/git-completion.bash4
1 files changed, 3 insertions, 1 deletions
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"
;;