aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-08-04 22:31:59 -0500
committerJunio C Hamano <gitster@pobox.com>2009-08-05 12:14:00 -0700
commitc2ca1d79dbd54b06a05e5d14a897699e59dc9f9f (patch)
tree18b07e292194aeae75649206b4a5513f11676025 /t
parent6a2d3f50f5a509fdfefca371c7178e36c0bcf7e9 (diff)
downloadgit-c2ca1d79dbd54b06a05e5d14a897699e59dc9f9f.tar.gz
git-c2ca1d79dbd54b06a05e5d14a897699e59dc9f9f.tar.xz
Allow mailsplit (and hence git-am) to handle mails with CRLF line-endings
It is not that uncommon to have mails with DOS line-ending, notably Thunderbird and web mailers like Gmail (when saving what they call "original" message). So modify mailsplit to convert CRLF line-endings to just LF. Since git-rebase is built on top of git-am, add an option to mailsplit to be used by git-am when it is acting on behalf of git-rebase, to refrain from doing this conversion. And add a test to make sure that rebase still works. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t3400-rebase.sh26
1 files changed, 24 insertions, 2 deletions
diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index c5c29ccc4..4e6a44b62 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -3,9 +3,10 @@
# Copyright (c) 2005 Amos Waterland
#
-test_description='git rebase should not destroy author information
+test_description='git rebase assorted tests
-This test runs git rebase and checks that the author information is not lost.
+This test runs git rebase and checks that the author information is not lost
+among other things.
'
. ./test-lib.sh
@@ -133,4 +134,25 @@ test_expect_success 'rebase -q is quiet' '
test ! -s output.out
'
+q_to_cr () {
+ tr Q '\015'
+}
+
+test_expect_success 'Rebase a commit that sprinkles CRs in' '
+ (
+ echo "One"
+ echo "TwoQ"
+ echo "Three"
+ echo "FQur"
+ echo "Five"
+ ) | q_to_cr >CR &&
+ git add CR &&
+ test_tick &&
+ git commit -a -m "A file with a line with CR" &&
+ git tag file-with-cr &&
+ git checkout HEAD^0 &&
+ git rebase --onto HEAD^^ HEAD^ &&
+ git diff --exit-code file-with-cr:CR HEAD:CR
+'
+
test_done