Skip to content

Commit ccab28a

Browse files
szedergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent dfbe5ee commit ccab28a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/completion/git-completion.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1716,7 +1716,7 @@ _git_send_email ()
17161716
--to|--cc|--bcc|--from)
17171717
__gitcomp "
17181718
$(git --git-dir="$(__gitdir)" send-email --dump-aliases 2>/dev/null)
1719-
" "" ""
1719+
"
17201720
return
17211721
;;
17221722
esac

0 commit comments

Comments
 (0)