Merge branch 'tr/maint-send-email-2047' into maint-1.7.11
"git send-email" did not unquote encoded words that appear on the header correctly, and lost "_" from strings. * tr/maint-send-email-2047: send-email: improve RFC2047 quote parsing
This commit is contained in:
commit
423a9e28fc
@ -862,11 +862,13 @@ $time = time - scalar $#files;
|
|||||||
sub unquote_rfc2047 {
|
sub unquote_rfc2047 {
|
||||||
local ($_) = @_;
|
local ($_) = @_;
|
||||||
my $encoding;
|
my $encoding;
|
||||||
if (s/=\?([^?]+)\?q\?(.*)\?=/$2/g) {
|
s{=\?([^?]+)\?q\?(.*?)\?=}{
|
||||||
$encoding = $1;
|
$encoding = $1;
|
||||||
s/_/ /g;
|
my $e = $2;
|
||||||
s/=([0-9A-F]{2})/chr(hex($1))/eg;
|
$e =~ s/_/ /g;
|
||||||
}
|
$e =~ s/=([0-9A-F]{2})/chr(hex($1))/eg;
|
||||||
|
$e;
|
||||||
|
}eg;
|
||||||
return wantarray ? ($_, $encoding) : $_;
|
return wantarray ? ($_, $encoding) : $_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -841,6 +841,19 @@ test_expect_success $PREREQ '--compose adds MIME for utf8 subject' '
|
|||||||
grep "^Subject: =?UTF-8?q?utf8-s=C3=BCbj=C3=ABct?=" msgtxt1
|
grep "^Subject: =?UTF-8?q?utf8-s=C3=BCbj=C3=ABct?=" msgtxt1
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success $PREREQ 'utf8 author is correctly passed on' '
|
||||||
|
clean_fake_sendmail &&
|
||||||
|
test_commit weird_author &&
|
||||||
|
test_when_finished "git reset --hard HEAD^" &&
|
||||||
|
git commit --amend --author "Füñný Nâmé <odd_?=mail@example.com>" &&
|
||||||
|
git format-patch --stdout -1 >funny_name.patch &&
|
||||||
|
git send-email --from="Example <nobody@example.com>" \
|
||||||
|
--to=nobody@example.com \
|
||||||
|
--smtp-server="$(pwd)/fake.sendmail" \
|
||||||
|
funny_name.patch &&
|
||||||
|
grep "^From: Füñný Nâmé <odd_?=mail@example.com>" msgtxt1
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success $PREREQ 'detects ambiguous reference/file conflict' '
|
test_expect_success $PREREQ 'detects ambiguous reference/file conflict' '
|
||||||
echo master > master &&
|
echo master > master &&
|
||||||
git add master &&
|
git add master &&
|
||||||
|
Loading…
Reference in New Issue
Block a user