Skip to content

Commit 68d42c4

Browse files
Haavard SkinnemoenJunio C Hamano
authored andcommitted
git-send-email: Don't set author_not_sender from Cc: lines
When an mbox-style patch contains a Cc: line in the header, git-send-email will check the address against the sender specified on the command line. If they don't match, sender_not_author will be set to the address obtained from the Cc line. When this happens, git-send-email inserts a From: line at the beginning of the message body with the address obtained from the Cc line in the header, and the sender might be accused of forging patch authors. This patch fixes this by only updating sender_not_author when processing From: lines, not when processing Cc: lines. Signed-off-by: Haavard Skinnemoen <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 44c1084 commit 68d42c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-send-email.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ sub send_message
510510
if ($2 eq $from) {
511511
next if ($suppress_from);
512512
}
513-
else {
513+
elsif ($1 eq 'From') {
514514
$author_not_sender = $2;
515515
}
516516
printf("(mbox) Adding cc: %s from line '%s'\n",

0 commit comments

Comments
 (0)