apply: make some parsing functions static again
[gitweb.git] / t / t4150-am.sh
index b41bd17264f93d54d5aa280fbc305cebb18950a0..9ce9424d1569a1d788d4ad1ecd59ed49ee712101 100755 (executable)
@@ -957,4 +957,24 @@ test_expect_success 'am -s unexpected trailer block' '
        test_cmp expect actual
 '
 
+test_expect_success 'am --patch-format=mboxrd handles mboxrd' '
+       rm -fr .git/rebase-apply &&
+       git checkout -f first &&
+       echo mboxrd >>file &&
+       git add file &&
+       cat >msg <<-\INPUT_END &&
+       mboxrd should escape the body
+
+       From could trip up a loose mbox parser
+       >From extra escape for reversibility
+       INPUT_END
+       git commit -F msg &&
+       git format-patch --pretty=mboxrd --stdout -1 >mboxrd1 &&
+       grep "^>From could trip up a loose mbox parser" mboxrd1 &&
+       git checkout -f first &&
+       git am --patch-format=mboxrd mboxrd1 &&
+       git cat-file commit HEAD | tail -n4 >out &&
+       test_cmp msg out
+'
+
 test_done