File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -412,9 +412,16 @@ __git_complete_revlist ()
412412
413413__git_complete_remote_or_refspec ()
414414{
415- local cmd=" ${COMP_WORDS[1 ]} "
415+ local cmd=" ${COMP_WORDS[0 ]} "
416416 local cur=" ${COMP_WORDS[COMP_CWORD]} "
417- local i c=2 remote=" " pfx=" " lhs=1 no_complete_refspec=0
417+ local i c=1 remote=" " pfx=" " lhs=1 no_complete_refspec=0
418+
419+ # adjust args upward when completing git *
420+ [ " $cmd " = " git" ] && {
421+ cmd=" ${COMP_WORDS[1]} "
422+ c=2
423+ }
424+
418425 while [ $c -lt $COMP_CWORD ]; do
419426 i=" ${COMP_WORDS[c]} "
420427 case " $i " in
@@ -792,7 +799,7 @@ _git_branch ()
792799
793800_git_bundle ()
794801{
795- local cmd=" ${COMP_WORDS[2 ]} "
802+ local cmd=" ${COMP_WORDS[1 ]} "
796803 case " $COMP_CWORD " in
797804 2)
798805 __gitcomp " create list-heads verify unbundle"
You can’t perform that action at this time.
0 commit comments