tests: test applying criss-cross rename patch
[git/jnareb-git.git] / t / t4130-apply-criss-cross-rename.sh
blob08c5f38b01c962121a8b5452bc304a555f610b15
1 #!/bin/sh
3 test_description='git apply handling criss-cross rename patch.'
4 . ./test-lib.sh
6 create_file() {
7 cnt=0
8 while test $cnt -le 100
9 do
10 cnt=$(($cnt + 1))
11 echo "$2" >> "$1"
12 done
15 test_expect_success 'setup' '
16 create_file file1 "File1 contents" &&
17 create_file file2 "File2 contents" &&
18 git add file1 file2 &&
19 git commit -m 1
22 test_expect_success 'criss-cross rename' '
23 mv file1 tmp &&
24 mv file2 file1 &&
25 mv tmp file2
28 test_expect_success 'diff -M -B' '
29 git diff -M -B > diff &&
30 git reset --hard
34 test_expect_failure 'apply' '
35 git apply diff
38 test_done