diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-11-13 22:37:25 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-11-13 22:37:25 +0900 |
commit | 2281aa872154af4cc10a05b09c79a1d41169111d (patch) | |
tree | cba0800a79e1347b1d02fef47538d429c421f1d1 | |
parent | Merge branch 'ds/add-missing-tags' (diff) | |
parent | send-email: avoid empty transfer encoding header (diff) | |
download | tgif-2281aa872154af4cc10a05b09c79a1d41169111d.tar.xz |
Merge branch 'al/send-email-auto-cte-fixup'
"git send-email --transfer-encoding=..." in recent versions of Git
sometimes produced an empty "Content-Transfer-Encoding:" header,
which has been corrected.
* al/send-email-auto-cte-fixup:
send-email: avoid empty transfer encoding header
-rwxr-xr-x | git-send-email.perl | 2 | ||||
-rwxr-xr-x | t/t9001-send-email.sh | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/git-send-email.perl b/git-send-email.perl index dc7e738e9c..4b9d3ad1bd 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -1848,7 +1848,7 @@ sub apply_transfer_encoding { my $from = shift; my $to = shift; - return $message if ($from eq $to and $from ne '7bit'); + return ($message, $to) if ($from eq $to and $from ne '7bit'); require MIME::QuotedPrint; require MIME::Base64; diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index 1ef1a19003..ee1efcc59d 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -492,6 +492,21 @@ do --validate \ $patches longline.patch ' + +done + +for enc in 7bit 8bit quoted-printable base64 +do + test_expect_success $PREREQ "--transfer-encoding=$enc produces correct header" ' + clean_fake_sendmail && + git send-email \ + --from="Example <nobody@example.com>" \ + --to=nobody@example.com \ + --smtp-server="$(pwd)/fake.sendmail" \ + --transfer-encoding=$enc \ + $patches && + grep "Content-Transfer-Encoding: $enc" msgtxt1 + ' done test_expect_success $PREREQ 'Invalid In-Reply-To' ' |