3 test_description
='typechange rename detection'
5 TEST_PASSES_SANITIZE_LEAK
=true
7 .
"$TEST_DIRECTORY"/lib-diff.sh
9 test_expect_success setup
'
12 COPYING_test_data >foo &&
13 test_ln_s_add linklink bar &&
15 git commit -a -m Initial &&
19 COPYING_test_data >bar &&
20 test_ln_s_add linklink foo &&
22 git commit -a -m Second &&
26 COPYING_test_data >foo &&
28 git commit -a -m Third &&
32 test_ln_s_add linklink foo &&
34 git commit -a -m Fourth &&
37 # This is purely for sanity check
40 COPYING_test_data >foo &&
41 cat "$TEST_DIRECTORY"/../Makefile >bar &&
43 git commit -a -m Fifth &&
47 cat "$TEST_DIRECTORY"/../Makefile >foo &&
48 COPYING_test_data >bar &&
50 git commit -a -m Sixth &&
55 test_expect_success
'cross renames to be detected for regular files' '
56 git diff-tree five six -r --name-status -B -M >out &&
59 echo "R100 foo bar" &&
62 test_cmp expect actual
66 test_expect_success
'cross renames to be detected for typechange' '
67 git diff-tree one two -r --name-status -B -M >out &&
70 echo "R100 foo bar" &&
73 test_cmp expect actual
77 test_expect_success
'moves and renames' '
78 git diff-tree three four -r --name-status -B -M >out &&
81 # see -B -M (#6) in t4008
82 echo "C100 foo bar" &&
85 test_cmp expect actual