summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2012-12-15 12:46:43 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-12-15 10:48:06 -0800
commit68539758579b3bd1f07fb9e1d800e7875db76c5c (patch)
treef8e9c41bbc85d699e245c5cff0cb0058ce15d260 /contrib
parentMerge branch 'maint' (diff)
downloadtgif-68539758579b3bd1f07fb9e1d800e7875db76c5c.tar.xz
completion: complete refs for "git commit -c"
The "-c" and "-C" options take an existing commit, so let's complete refs, just as we would for --squash or --fixup. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/completion/git-completion.bash7
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 0b77eb1fa4..a4c48e179e 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -971,6 +971,13 @@ _git_commit ()
{
__git_has_doubledash && return
+ case "$prev" in
+ -c|-C)
+ __gitcomp_nl "$(__git_refs)" "" "${cur}"
+ return
+ ;;
+ esac
+
case "$cur" in
--cleanup=*)
__gitcomp "default strip verbatim whitespace