Merge branch 'sa/send-email-dedup-some-headers'
authorJunio C Hamano <gitster@pobox.com>
Tue, 8 May 2018 06:59:31 +0000 (15:59 +0900)
committerJunio C Hamano <gitster@pobox.com>
Tue, 8 May 2018 06:59:31 +0000 (15:59 +0900)
When fed input that already has In-Reply-To: and/or References:
headers and told to add the same information, "git send-email"
added these headers separately, instead of appending to an existing
one, which is a violation of the RFC. This has been corrected.

* sa/send-email-dedup-some-headers:
send-email: avoid duplicate In-Reply-To/References

git-send-email.perl
index 2fa7818ca9a8ac7363d17aef17b864f7361b3eb8..7157397fd03a0791b7722ab49aa696181977381c 100755 (executable)
@@ -1642,10 +1642,15 @@ sub send_message {
                        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,