OSDN Git Service

completion: complete refs for "git commit -c"
authorJeff King <peff@peff.net>
Sat, 15 Dec 2012 17:46:43 +0000 (12:46 -0500)
committerJunio C Hamano <gitster@pobox.com>
Sat, 15 Dec 2012 18:48:06 +0000 (10:48 -0800)
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>
contrib/completion/git-completion.bash

index 0b77eb1..a4c48e1 100644 (file)
@@ -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