Skip to content

Commit

Permalink
completion: simplify by using $prev
Browse files Browse the repository at this point in the history
cword-1 is the previous word ($prev).

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Felipe Contreras authored and Junio C Hamano committed Apr 22, 2012
1 parent 3bf421e commit 3954068
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -1658,7 +1658,7 @@ _git_notes ()
__gitcomp '--ref'
;;
,*)
case "${words[cword-1]}" in
case "$prev" in
--ref)
__gitcomp_nl "$(__git_refs)"
;;
Expand All @@ -1684,7 +1684,7 @@ _git_notes ()
prune,*)
;;
*)
case "${words[cword-1]}" in
case "$prev" in
-m|-F)
;;
*)
Expand Down

0 comments on commit 3954068

Please sign in to comment.