X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft4150-am.sh;h=810b04b817c79d2b4c478f767843b4e7a42e0bed;hb=750ef42516bb343a7755f003720e43cd8dd64c3e;hp=8296605234ddc82697a51de0a09b703635b4c9f4;hpb=c214f2c80c70c2a3803bf1f3efc323cee5496024;p=git.git diff --git a/t/t4150-am.sh b/t/t4150-am.sh index 829660523..810b04b81 100755 --- a/t/t4150-am.sh +++ b/t/t4150-am.sh @@ -83,6 +83,12 @@ test_expect_success setup ' echo "X-Fake-Field: Line Three" && git format-patch --stdout first | sed -e "1d" } > patch1.eml && + { + 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" + } | append_cr >patch1-crlf.eml && sed -n -e "3,\$p" msg >file && git add file && test_tick && @@ -123,6 +129,15 @@ test_expect_success 'am applies patch e-mail not in a mbox' ' test "$(git rev-parse second^)" = "$(git rev-parse HEAD^)" ' +test_expect_success 'am applies patch e-mail not in a mbox with CRLF' ' + git checkout first && + git am patch1-crlf.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" @@ -287,7 +302,7 @@ test_expect_success 'am --committer-date-is-author-date' ' git checkout first && test_tick && git am --committer-date-is-author-date patch1 && - git cat-file commit HEAD | sed -e "/^$/q" >head1 && + git cat-file commit HEAD | sed -e "/^\$/q" >head1 && at=$(sed -ne "/^author /s/.*> //p" head1) && ct=$(sed -ne "/^committer /s/.*> //p" head1) && test "$at" = "$ct" @@ -297,7 +312,7 @@ test_expect_success 'am without --committer-date-is-author-date' ' git checkout first && test_tick && git am patch1 && - git cat-file commit HEAD | sed -e "/^$/q" >head1 && + git cat-file commit HEAD | sed -e "/^\$/q" >head1 && at=$(sed -ne "/^author /s/.*> //p" head1) && ct=$(sed -ne "/^committer /s/.*> //p" head1) && test "$at" != "$ct" @@ -311,7 +326,7 @@ test_expect_success 'am --ignore-date' ' git checkout first && test_tick && git am --ignore-date patch1 && - git cat-file commit HEAD | sed -e "/^$/q" >head1 && + git cat-file commit HEAD | sed -e "/^\$/q" >head1 && at=$(sed -ne "/^author /s/.*> //p" head1) && echo "$at" | grep "+0000" '