1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-05 14:06:15 +02:00

git-send-email.perl: Deduplicate "to:" and "cc:" entries with names

If an email address in the "to:" list is in the style
"First Last <email@domain.tld>", ie: not just a bare
address like "email@domain.tld", and the same named
entry style exists in the "cc:" list, the current
logic will not remove the entry from the "cc:" list.

Add logic to better deduplicate the "cc:" list by also
matching the email address with angle brackets.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Joe Perches 2010-11-20 15:06:05 -08:00 committed by Junio C Hamano
parent e93368d26e
commit 83acaaec12

View File

@ -940,7 +940,7 @@ sub maildomain {
sub send_message {
my @recipients = unique_email_list(@to);
@cc = (grep { my $cc = extract_valid_address($_);
not grep { $cc eq $_ } @recipients
not grep { $cc eq $_ || $_ =~ /<\Q${cc}\E>$/ } @recipients
}
map { sanitize_address($_) }
@cc);