git.99rst.org
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
3bf421e
)
completion: simplify by using $prev
author
Felipe Contreras
<redacted>
Sun, 15 Apr 2012 19:44:17 +0000
(22:44 +0300)
committer
Junio C Hamano
<redacted>
Sun, 22 Apr 2012 05:39:06 +0000
(22:39 -0700)
cword-1 is the previous word ($prev).
Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
contrib/completion/git-completion.bash
patch
|
blob
|
history
diff --git
a/contrib/completion/git-completion.bash
b/contrib/completion/git-completion.bash
index db2d3cc3fde3490eeb8724ce56b77babce235f14..8c91faf1af966236d3389be2ff0638647e405e7e 100755
(executable)
--- a/
contrib/completion/git-completion.bash
+++ b/
contrib/completion/git-completion.bash
@@
-1658,7
+1658,7
@@
_git_notes ()
__gitcomp '--ref'
;;
,*)
- case "$
{words[cword-1]}
" in
+ case "$
prev
" in
--ref)
__gitcomp_nl "$(__git_refs)"
;;
@@
-1684,7
+1684,7
@@
_git_notes ()
prune,*)
;;
*)
- case "$
{words[cword-1]}
" in
+ case "$
prev
" in
-m|-F)
;;
*)
git clone https://git.99rst.org/PROJECT