Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-06-05 07:46:41 +0300
committerJunio C Hamano <gitster@pobox.com>2016-06-06 21:40:15 +0300
commitd9925d1a714a440f4063f64e1bd776194d2dd918 (patch)
tree9fa4ce3c6e7ece9ce5212e7e62820be0eb35973b /t/t4150-am.sh
parentc88098d7f19c6322fbd911bb89e2efd246bf75c4 (diff)
am: support --patch-format=mboxrd
Combined with "git format-patch --pretty=mboxrd", this should allow us to round-trip commit messages with embedded mbox "From " lines without corruption. Signed-off-by: Eric Wong <e@80x24.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4150-am.sh')
-rwxr-xr-xt/t4150-am.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index b41bd17264..9ce9424d15 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -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