summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-04-18 04:42:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-04-18 04:42:13 (GMT)
commitfc917ad6b294366d3afc7a14b1bfe41fa8c567a2 (patch)
treeea5e1d76bbe27a09f4ae4c173b57afa24e81e364 /t
parent66aae6c1bac1668483f3dbe3875fc9d9655e9408 (diff)
parent7fac0eef91cf930ef827b00934701fa5543dce76 (diff)
downloadgit-fc917ad6b294366d3afc7a14b1bfe41fa8c567a2.zip
git-fc917ad6b294366d3afc7a14b1bfe41fa8c567a2.tar.gz
git-fc917ad6b294366d3afc7a14b1bfe41fa8c567a2.tar.bz2
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-xt/t4130-apply-criss-cross-rename.sh38
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 0000000..8623dbe
--- /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