summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2009-04-17 21:42:13 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-04-17 21:42:13 -0700
commitfc917ad6b294366d3afc7a14b1bfe41fa8c567a2 (patch)
treeea5e1d76bbe27a09f4ae4c173b57afa24e81e364 /t
parentMerge branch 'mm/add-p-quit' (diff)
parentbuiltin-apply: keep information about files to be deleted (diff)
downloadtgif-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-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 0000000000..8623dbebab
--- /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