Skip to content

Commit 6853975

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 790c83c commit 6853975

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

contrib/completion/git-completion.bash

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,13 @@ _git_commit ()
971971
{
972972
__git_has_doubledash && return
973973

974+
case "$prev" in
975+
-c|-C)
976+
__gitcomp_nl "$(__git_refs)" "" "${cur}"
977+
return
978+
;;
979+
esac
980+
974981
case "$cur" in
975982
--cleanup=*)
976983
__gitcomp "default strip verbatim whitespace

0 commit comments

Comments
 (0)