@matheusbsbs / matheus-bagliano / commits / 83acaaec12
Fork 0

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>

Joe Perches committed Nov 20, 2010 at 15:06 UTC 83acaaec12fcf33e605f441216ecc91c81b90449
1 file changed +1 -1
git-send-email.perl
+1 -1
@@ -940,7 +940,7 @@ sub maildomain {
940 sub send_message {
941 my @recipients = unique_email_list(@to);
942 @cc = (grep { my $cc = extract_valid_address($_);
943 - not grep { $cc eq $_ } @recipients
943 + not grep { $cc eq $_ || $_ =~ /<\Q${cc}\E>$/ } @recipients
944 }
945 map { sanitize_address($_) }
946 @cc);