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
This commit is contained in:
Junio C Hamano 2018-11-13 22:37:25 +09:00
commit 2281aa8721
2 changed files with 16 additions and 1 deletions

View File

@ -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;

View File

@ -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' '