summaryrefslogtreecommitdiff
path: root/t/t4150-am.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t4150-am.sh')
-rwxr-xr-xt/t4150-am.sh21
1 files changed, 18 insertions, 3 deletions
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index 8296605..810b04b 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"
'