3 test_description
='typechange rename detection'
6 .
"$TEST_DIRECTORY"/lib-diff.sh
8 test_expect_success setup
'
11 COPYING_test_data >foo &&
12 test_ln_s_add linklink bar &&
14 git commit -a -m Initial &&
18 COPYING_test_data >bar &&
19 test_ln_s_add linklink foo &&
21 git commit -a -m Second &&
25 COPYING_test_data >foo &&
27 git commit -a -m Third &&
31 test_ln_s_add linklink foo &&
33 git commit -a -m Fourth &&
36 # This is purely for sanity check
39 COPYING_test_data >foo &&
40 cat "$TEST_DIRECTORY"/../Makefile >bar &&
42 git commit -a -m Fifth &&
46 cat "$TEST_DIRECTORY"/../Makefile >foo &&
47 COPYING_test_data >bar &&
49 git commit -a -m Sixth &&
54 test_expect_success
'cross renames to be detected for regular files' '
55 git diff-tree five six -r --name-status -B -M >out &&
58 echo "R100 foo bar" &&
61 test_cmp expect actual
65 test_expect_success
'cross renames to be detected for typechange' '
66 git diff-tree one two -r --name-status -B -M >out &&
69 echo "R100 foo bar" &&
72 test_cmp expect actual
76 test_expect_success
'moves and renames' '
77 git diff-tree three four -r --name-status -B -M >out &&
80 # see -B -M (#6) in t4008
81 echo "C100 foo bar" &&
84 test_cmp expect actual