summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder@ira.uka.de>2015-12-12 00:18:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-12-14 22:01:37 (GMT)
commitccab28a947d34a8d3d7e32569e82400bc0fe3c0c (patch)
tree7be2e055e584e81292baaa6c3ebc486e50cdbe45 /contrib
parentdfbe5eeb321c4887328f134afe09e98dc722a365 (diff)
downloadgit-ccab28a947d34a8d3d7e32569e82400bc0fe3c0c.zip
git-ccab28a947d34a8d3d7e32569e82400bc0fe3c0c.tar.gz
git-ccab28a947d34a8d3d7e32569e82400bc0fe3c0c.tar.bz2
completion: fix completing unstuck email alias arguments
Completing unstuck form of email aliases doesn't quite work: $ git send-email --to <TAB> alice bob cecil $ git send-email --to a<TAB> alice bob cecil While listing email aliases works as expected, the second case should just complete to 'alice', but it keeps offering all email aliases instead. The cause for this behavior is that in this case we mistakenly tell __gitcomp() explicitly that the current word to be completed is empty, while in reality it is not. As a result __gitcomp() doesn't filter out non-matching aliases, so all aliases end up being offered over and over again. Fix this by not passing the current word to be completed to __gitcomp() and letting it go the default route and grab it from the '$cur' variable. Don't pass empty prefix either, because it's assumed to be empty when unspecified, so it's not necessary. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/completion/git-completion.bash2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 111b053..d9b9957 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1716,7 +1716,7 @@ _git_send_email ()
--to|--cc|--bcc|--from)
__gitcomp "
$(git --git-dir="$(__gitdir)" send-email --dump-aliases 2>/dev/null)
- " "" ""
+ "
return
;;
esac