提交 5983ddc1 编写于 作者: J Junio C Hamano

Merge branch 'bc/send-email-qp-cr'

"git send-email" has been taught to use quoted-printable when the
payload contains carriage-return.  The use of the mechanism is in
line with the design originally added the codepath that chooses QP
when the payload has overly long lines.

* bc/send-email-qp-cr:
  send-email: default to quoted-printable when CR is present
......@@ -1872,7 +1872,7 @@ sub apply_transfer_encoding {
$message = MIME::Base64::decode($message)
if ($from eq 'base64');
$to = ($message =~ /.{999,}/) ? 'quoted-printable' : '8bit'
$to = ($message =~ /(?:.{999,}|\r)/) ? 'quoted-printable' : '8bit'
if $to eq 'auto';
die __("cannot send message as 7bit")
......
......@@ -481,6 +481,20 @@ test_expect_success $PREREQ 'long lines with auto encoding are quoted-printable'
grep "Content-Transfer-Encoding: quoted-printable" msgtxt1
'
test_expect_success $PREREQ 'carriage returns with auto encoding are quoted-printable' '
clean_fake_sendmail &&
cp $patches cr.patch &&
printf "this is a line\r\n" >>cr.patch &&
git send-email \
--from="Example <nobody@example.com>" \
--to=nobody@example.com \
--smtp-server="$(pwd)/fake.sendmail" \
--transfer-encoding=auto \
--no-validate \
cr.patch &&
grep "Content-Transfer-Encoding: quoted-printable" msgtxt1
'
for enc in auto quoted-printable base64
do
test_expect_success $PREREQ "--validate passes with encoding $enc" '
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册