diff options
author | Stefan Agner <stefan@agner.ch> | 2018-04-17 23:16:30 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-04-19 00:04:29 +0200 |
commit | 256be1d3f0439b397a573f90868b8d09e11afbdf (patch) | |
tree | 3670e6c1d56224a2490960901430d7e77b306c6c /git-send-email.perl | |
parent | Git 2.17 (diff) | |
download | git-256be1d3f0439b397a573f90868b8d09e11afbdf.tar.xz git-256be1d3f0439b397a573f90868b8d09e11afbdf.zip |
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 <stefan@agner.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-x | git-send-email.perl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/git-send-email.perl b/git-send-email.perl index 2fa7818ca9..7157397fd0 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -1642,10 +1642,15 @@ foreach my $t (@files) { elsif (/^Content-Transfer-Encoding: (.*)/i) { $xfer_encoding = $1 if not defined $xfer_encoding; } + elsif (/^In-Reply-To: (.*)/i) { + $in_reply_to = $1; + } + elsif (/^References: (.*)/i) { + $references = $1; + } elsif (!/^Date:\s/i && /^[-A-Za-z]+:\s+\S/) { push @xh, $_; } - } else { # In the traditional # "send lots of email" format, |