diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-04-17 21:42:13 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-04-17 21:42:13 -0700 |
commit | fc917ad6b294366d3afc7a14b1bfe41fa8c567a2 (patch) | |
tree | ea5e1d76bbe27a09f4ae4c173b57afa24e81e364 /t | |
parent | 66aae6c1bac1668483f3dbe3875fc9d9655e9408 (diff) | |
parent | 7fac0eef91cf930ef827b00934701fa5543dce76 (diff) | |
download | git-fc917ad6b294366d3afc7a14b1bfe41fa8c567a2.tar.gz git-fc917ad6b294366d3afc7a14b1bfe41fa8c567a2.tar.xz |
Merge branch 'mk/apply-swap'
* mk/apply-swap:
builtin-apply: keep information about files to be deleted
tests: test applying criss-cross rename patch
Diffstat (limited to 't')
-rwxr-xr-x | t/t4130-apply-criss-cross-rename.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/t/t4130-apply-criss-cross-rename.sh b/t/t4130-apply-criss-cross-rename.sh new file mode 100755 index 000000000..8623dbeba --- /dev/null +++ b/t/t4130-apply-criss-cross-rename.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +test_description='git apply handling criss-cross rename patch.' +. ./test-lib.sh + +create_file() { + cnt=0 + while test $cnt -le 100 + do + cnt=$(($cnt + 1)) + echo "$2" >> "$1" + done +} + +test_expect_success 'setup' ' + create_file file1 "File1 contents" && + create_file file2 "File2 contents" && + git add file1 file2 && + git commit -m 1 +' + +test_expect_success 'criss-cross rename' ' + mv file1 tmp && + mv file2 file1 && + mv tmp file2 +' + +test_expect_success 'diff -M -B' ' + git diff -M -B > diff && + git reset --hard + +' + +test_expect_success 'apply' ' + git apply diff +' + +test_done |