X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=inline;f=t%2Ft4150-am.sh;h=d7d9ccc1c8c31ef3b2d4763532344d0637a18b5c;hb=8f41c07f90da5e314cbc428f1e3e936563f7f39d;hp=151404e0908c55f3c0d399d03225b077dc226562;hpb=6dd5622f68157f471c4f784e8c41f39e8c5163fc;p=git.git diff --git a/t/t4150-am.sh b/t/t4150-am.sh index 151404e09..d7d9ccc1c 100755 --- a/t/t4150-am.sh +++ b/t/t4150-am.sh @@ -96,6 +96,13 @@ test_expect_success setup ' echo "X-Fake-Field: Line Three" && git format-patch --stdout first | sed -e "1d" } | append_cr >patch1-crlf.eml && + { + printf "%255s\\n" "" + 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-ws.eml && sed -n -e "3,\$p" msg >file && git add file && @@ -167,6 +174,17 @@ test_expect_success 'am applies patch e-mail not in a mbox with CRLF' ' test "$(git rev-parse second^)" = "$(git rev-parse HEAD^)" ' +test_expect_success 'am applies patch e-mail with preceding whitespace' ' + rm -fr .git/rebase-apply && + git reset --hard && + git checkout first && + git am patch1-ws.eml && + ! test -d .git/rebase-apply && + git diff --exit-code second && + test "$(git rev-parse second)" = "$(git rev-parse HEAD)" && + test "$(git rev-parse second^)" = "$(git rev-parse HEAD^)" +' + test_expect_success 'setup: new author and committer' ' GIT_AUTHOR_NAME="Another Thor" && GIT_AUTHOR_EMAIL="a.thor@example.com" &&