Skip to content

Commit 3954068

Browse files
felipecgitster
authored andcommitted
completion: simplify by using $prev
cword-1 is the previous word ($prev). Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3bf421e commit 3954068

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/completion/git-completion.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,7 +1658,7 @@ _git_notes ()
16581658
__gitcomp '--ref'
16591659
;;
16601660
,*)
1661-
case "${words[cword-1]}" in
1661+
case "$prev" in
16621662
--ref)
16631663
__gitcomp_nl "$(__git_refs)"
16641664
;;
@@ -1684,7 +1684,7 @@ _git_notes ()
16841684
prune,*)
16851685
;;
16861686
*)
1687-
case "${words[cword-1]}" in
1687+
case "$prev" in
16881688
-m|-F)
16891689
;;
16901690
*)

0 commit comments

Comments
 (0)