summaryrefslogtreecommitdiff
path: root/t/t4014-format-patch.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-07-06 20:38:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-07-06 20:38:11 (GMT)
commite25a4ded8a47333a4c71a224927d6df87d7c295e (patch)
tree7a0801d3ea9453ee23101f187e1ef9bf65b2ac48 /t/t4014-format-patch.sh
parent1e4bf907890e094f1c1c8c5086387e7d5fdb0655 (diff)
parentd9925d1a714a440f4063f64e1bd776194d2dd918 (diff)
downloadgit-e25a4ded8a47333a4c71a224927d6df87d7c295e.zip
git-e25a4ded8a47333a4c71a224927d6df87d7c295e.tar.gz
git-e25a4ded8a47333a4c71a224927d6df87d7c295e.tar.bz2
Merge branch 'ew/mboxrd-format-am'
Teach format-patch and mailsplit (hence "am") how a line that happens to begin with "From " in the e-mail message is quoted with ">", so that these lines can be restored to their original shape. * ew/mboxrd-format-am: am: support --patch-format=mboxrd mailsplit: support unescaping mboxrd messages pretty: support "mboxrd" output format
Diffstat (limited to 't/t4014-format-patch.sh')
-rwxr-xr-xt/t4014-format-patch.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 805dc90..1206c48 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -1565,4 +1565,45 @@ test_expect_success 'format-patch --base overrides format.useAutoBase' '
test_cmp expected actual
'
+test_expect_success 'format-patch --pretty=mboxrd' '
+ sp=" " &&
+ cat >msg <<-INPUT_END &&
+ mboxrd should escape the body
+
+ From could trip up a loose mbox parser
+ >From extra escape for reversibility
+ >>From extra escape for reversibility 2
+ from lower case not escaped
+ Fromm bad speling not escaped
+ From with leading space not escaped
+
+ F
+ From
+ From$sp
+ From $sp
+ From $sp
+ INPUT_END
+
+ cat >expect <<-INPUT_END &&
+ >From could trip up a loose mbox parser
+ >>From extra escape for reversibility
+ >>>From extra escape for reversibility 2
+ from lower case not escaped
+ Fromm bad speling not escaped
+ From with leading space not escaped
+
+ F
+ From
+ From
+ From
+ From
+ INPUT_END
+
+ C=$(git commit-tree HEAD^^{tree} -p HEAD <msg) &&
+ git format-patch --pretty=mboxrd --stdout -1 $C~1..$C >patch &&
+ git grep -h --no-index -A11 \
+ "^>From could trip up a loose mbox parser" patch >actual &&
+ test_cmp expect actual
+'
+
test_done