3 test_description
='typechange rename detection'
7 test_expect_success setup
'
10 cat "$TEST_DIRECTORY"/../COPYING >foo &&
12 test_ln_s_add linklink bar &&
14 git commit -a -m Initial &&
18 cat "$TEST_DIRECTORY"/../COPYING >bar &&
19 test_ln_s_add linklink foo &&
21 git commit -a -m Second &&
25 cat "$TEST_DIRECTORY"/../COPYING >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 cat "$TEST_DIRECTORY"/../COPYING >foo &&
40 cat "$TEST_DIRECTORY"/../Makefile >bar &&
42 git commit -a -m Fifth &&
46 cat "$TEST_DIRECTORY"/../Makefile >foo &&
47 cat "$TEST_DIRECTORY"/../COPYING >bar &&
49 git commit -a -m Sixth &&
54 test_expect_success
'cross renames to be detected for regular files' '
56 git diff-tree five six -r --name-status -B -M | sort >actual &&
61 test_cmp expect actual
65 test_expect_success
'cross renames to be detected for typechange' '
67 git diff-tree one two -r --name-status -B -M | sort >actual &&
72 test_cmp expect actual
76 test_expect_success
'moves and renames' '
78 git diff-tree three four -r --name-status -B -M | sort >actual &&
83 test_cmp expect actual