Code

Merge branch 'maint'
[git.git] / t / t4150-am.sh
index a12bf846231d18b2a815151d1a0e1ab3d5f491d1..8296605234ddc82697a51de0a09b703635b4c9f4 100755 (executable)
@@ -77,6 +77,12 @@ test_expect_success setup '
        git commit -s -F msg &&
        git tag second &&
        git format-patch --stdout first >patch1 &&
+       {
+               echo "X-Fake-Field: Line One" &&
+               echo "X-Fake-Field: Line Two" &&
+               echo "X-Fake-Field: Line Three" &&
+               git format-patch --stdout first | sed -e "1d"
+       } > patch1.eml &&
        sed -n -e "3,\$p" msg >file &&
        git add file &&
        test_tick &&
@@ -108,6 +114,15 @@ test_expect_success 'am applies patch correctly' '
        test "$(git rev-parse second^)" = "$(git rev-parse HEAD^)"
 '
 
+test_expect_success 'am applies patch e-mail not in a mbox' '
+       git checkout first &&
+       git am patch1.eml &&
+       ! test -d .git/rebase-apply &&
+       test -z "$(git diff second)" &&
+       test "$(git rev-parse second)" = "$(git rev-parse HEAD)" &&
+       test "$(git rev-parse second^)" = "$(git rev-parse HEAD^)"
+'
+
 GIT_AUTHOR_NAME="Another Thor"
 GIT_AUTHOR_EMAIL="a.thor@example.com"
 GIT_COMMITTER_NAME="Co M Miter"