08c5f38b01c962121a8b5452bc304a555f610b15
1#!/bin/sh
2
3test_description='git apply handling criss-cross rename patch.'
4. ./test-lib.sh
5
6create_file() {
7 cnt=0
8 while test $cnt -le 100
9 do
10 cnt=$(($cnt + 1))
11 echo "$2" >> "$1"
12 done
13}
14
15test_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
20'
21
22test_expect_success 'criss-cross rename' '
23 mv file1 tmp &&
24 mv file2 file1 &&
25 mv tmp file2
26'
27
28test_expect_success 'diff -M -B' '
29 git diff -M -B > diff &&
30 git reset --hard
31
32'
33
34test_expect_failure 'apply' '
35 git apply diff
36'
37
38test_done