3 test_description
='git apply handling criss-cross rename patch.'
5 TEST_PASSES_SANITIZE_LEAK
=true
10 while test $cnt -le 100
17 test_expect_success
'setup' '
18 # Ensure that file sizes are different, because on Windows
19 # lstat() does not discover inode numbers, and we need
20 # other properties to discover swapped files
21 # (mtime is not always different, either).
22 create_file file1 "some content" &&
23 create_file file2 "some other content" &&
24 create_file file3 "again something else" &&
25 git add file1 file2 file3 &&
29 test_expect_success
'criss-cross rename' '
33 cp file1 file1-swapped &&
34 cp file2 file2-swapped
37 test_expect_success
'diff -M -B' '
38 git diff -M -B > diff &&
43 test_expect_success
'apply' '
45 test_cmp file1 file1-swapped &&
46 test_cmp file2 file2-swapped
49 test_expect_success
'criss-cross rename' '
55 cp file1 file1-swapped &&
56 cp file2 file2-swapped &&
57 cp file3 file3-swapped
60 test_expect_success
'diff -M -B' '
61 git diff -M -B > diff &&
65 test_expect_success
'apply' '
67 test_cmp file1 file1-swapped &&
68 test_cmp file2 file2-swapped &&
69 test_cmp file3 file3-swapped