Skip to content

Commit 2281aa8

Browse files
committed
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
2 parents 291123e + 3c88e46 commit 2281aa8

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

git-send-email.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1848,7 +1848,7 @@ sub apply_transfer_encoding {
18481848
my $from = shift;
18491849
my $to = shift;
18501850

1851-
return $message if ($from eq $to and $from ne '7bit');
1851+
return ($message, $to) if ($from eq $to and $from ne '7bit');
18521852

18531853
require MIME::QuotedPrint;
18541854
require MIME::Base64;

t/t9001-send-email.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,21 @@ do
492492
--validate \
493493
$patches longline.patch
494494
'
495+
496+
done
497+
498+
for enc in 7bit 8bit quoted-printable base64
499+
do
500+
test_expect_success $PREREQ "--transfer-encoding=$enc produces correct header" '
501+
clean_fake_sendmail &&
502+
git send-email \
503+
--from="Example <[email protected]>" \
504+
505+
--smtp-server="$(pwd)/fake.sendmail" \
506+
--transfer-encoding=$enc \
507+
$patches &&
508+
grep "Content-Transfer-Encoding: $enc" msgtxt1
509+
'
495510
done
496511

497512
test_expect_success $PREREQ 'Invalid In-Reply-To' '

0 commit comments

Comments
 (0)