diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-07-06 15:38:28 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-07-06 15:38:28 -0700 |
commit | 25d33546d474c7c28b72013c262fc23337cb3b21 (patch) | |
tree | 7551eb457a33329be6b3bb0fc11f76118a6e2c42 /t/t4253-am-keep-cr-dos.sh | |
parent | Merge commit 'v1.7.0' into jc/checkout-reflog-fix (diff) | |
parent | Git 1.7.6 (diff) | |
download | tgif-25d33546d474c7c28b72013c262fc23337cb3b21.tar.xz |
Merge commit 'v1.7.6' into jc/checkout-reflog-fix
* commit 'v1.7.6': (3211 commits)
Git 1.7.6
completion: replace core.abbrevguard to core.abbrev
Git 1.7.6-rc3
Documentation: git diff --check respects core.whitespace
gitweb: 'pickaxe' and 'grep' features requires 'search' to be enabled
t7810: avoid unportable use of "echo"
plug a few coverity-spotted leaks
builtin/gc.c: add missing newline in message
tests: link shell libraries into valgrind directory
t/Makefile: pass test opts to valgrind target properly
sh-i18n--envsubst.c: do not #include getopt.h
Fix typo: existant->existent
Git 1.7.6-rc2
gitweb: do not misparse nonnumeric content tag files that contain a digit
Git 1.7.6-rc1
fetch: do not leak a refspec
t3703: skip more tests using colons in file names on Windows
gitweb: Fix usability of $prevent_xss
gitweb: Move "Requirements" up in gitweb/INSTALL
gitweb: Describe CSSMIN and JSMIN in gitweb/INSTALL
...
Diffstat (limited to 't/t4253-am-keep-cr-dos.sh')
-rwxr-xr-x | t/t4253-am-keep-cr-dos.sh | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/t/t4253-am-keep-cr-dos.sh b/t/t4253-am-keep-cr-dos.sh new file mode 100755 index 0000000000..735e55d77c --- /dev/null +++ b/t/t4253-am-keep-cr-dos.sh @@ -0,0 +1,96 @@ +#!/bin/sh +# +# Copyright (c) 2010 Stefan-W. Hahn +# + +test_description='git-am mbox with dos line ending. + +' +. ./test-lib.sh + +# Three patches which will be added as files with dos line ending. + +cat >file1 <<\EOF +line 1 +EOF + +cat >file1a <<\EOF +line 1 +line 4 +EOF + +cat >file2 <<\EOF +line 1 +line 2 +EOF + +cat >file3 <<\EOF +line 1 +line 2 +line 3 +EOF + +test_expect_success 'setup repository with dos files' ' + append_cr <file1 >file && + git add file && + git commit -m Initial && + git tag initial && + append_cr <file2 >file && + git commit -a -m Second && + append_cr <file3 >file && + git commit -a -m Third +' + +test_expect_success 'am with dos files without --keep-cr' ' + git checkout -b dosfiles initial && + git format-patch -k initial..master && + test_must_fail git am -k -3 000*.patch && + git am --abort && + rm -rf .git/rebase-apply 000*.patch +' + +test_expect_success 'am with dos files with --keep-cr' ' + git checkout -b dosfiles-keep-cr initial && + git format-patch -k --stdout initial..master | git am --keep-cr -k -3 && + git diff --exit-code master +' + +test_expect_success 'am with dos files config am.keepcr' ' + git config am.keepcr 1 && + git checkout -b dosfiles-conf-keepcr initial && + git format-patch -k --stdout initial..master | git am -k -3 && + git diff --exit-code master +' + +test_expect_success 'am with dos files config am.keepcr overriden by --no-keep-cr' ' + git config am.keepcr 1 && + git checkout -b dosfiles-conf-keepcr-override initial && + git format-patch -k initial..master && + test_must_fail git am -k -3 --no-keep-cr 000*.patch && + git am --abort && + rm -rf .git/rebase-apply 000*.patch +' + +test_expect_success 'am with dos files with --keep-cr continue' ' + git checkout -b dosfiles-keep-cr-continue initial && + git format-patch -k initial..master && + append_cr <file1a >file && + git commit -m "different patch" file && + test_must_fail git am --keep-cr -k -3 000*.patch && + append_cr <file2 >file && + git add file && + git am -3 --resolved && + git diff --exit-code master +' + +test_expect_success 'am with unix files config am.keepcr overriden by --no-keep-cr' ' + git config am.keepcr 1 && + git checkout -b unixfiles-conf-keepcr-override initial && + cp -f file1 file && + git commit -m "line ending to unix" file && + git format-patch -k initial..master && + git am -k -3 --no-keep-cr 000*.patch && + git diff --exit-code -w master +' + +test_done |