Skip to content

Commit 256be1d

Browse files
agnersgitster
authored andcommitted
send-email: avoid duplicate In-Reply-To/References
In case a patch already has In-Reply-To or References in the header (e.g. when the patch has been created with format-patch --thread) git-send-email should not add another pair of those headers. This is also not allowed according to RFC 5322 Section 3.6: https://tools.ietf.org/html/rfc5322#section-3.6 Avoid the second pair by reading the current headers into the appropriate variables. Signed-off-by: Stefan Agner <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 468165c commit 256be1d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

git-send-email.perl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1642,10 +1642,15 @@ sub send_message {
16421642
elsif (/^Content-Transfer-Encoding: (.*)/i) {
16431643
$xfer_encoding = $1 if not defined $xfer_encoding;
16441644
}
1645+
elsif (/^In-Reply-To: (.*)/i) {
1646+
$in_reply_to = $1;
1647+
}
1648+
elsif (/^References: (.*)/i) {
1649+
$references = $1;
1650+
}
16451651
elsif (!/^Date:\s/i && /^[-A-Za-z]+:\s+\S/) {
16461652
push @xh, $_;
16471653
}
1648-
16491654
} else {
16501655
# In the traditional
16511656
# "send lots of email" format,

0 commit comments

Comments
 (0)