3 test_description
='typechange rename detection'
7 test_expect_success setup
'
10 cat "$TEST_DIRECTORY"/../COPYING >foo &&
11 test_ln_s_add linklink bar &&
13 git commit -a -m Initial &&
17 cat "$TEST_DIRECTORY"/../COPYING >bar &&
18 test_ln_s_add linklink foo &&
20 git commit -a -m Second &&
24 cat "$TEST_DIRECTORY"/../COPYING >foo &&
26 git commit -a -m Third &&
30 test_ln_s_add linklink foo &&
32 git commit -a -m Fourth &&
35 # This is purely for sanity check
38 cat "$TEST_DIRECTORY"/../COPYING >foo &&
39 cat "$TEST_DIRECTORY"/../Makefile >bar &&
41 git commit -a -m Fifth &&
45 cat "$TEST_DIRECTORY"/../Makefile >foo &&
46 cat "$TEST_DIRECTORY"/../COPYING >bar &&
48 git commit -a -m Sixth &&
53 test_expect_success
'cross renames to be detected for regular files' '
55 git diff-tree five six -r --name-status -B -M | sort >actual &&
60 test_cmp expect actual
64 test_expect_success
'cross renames to be detected for typechange' '
66 git diff-tree one two -r --name-status -B -M | sort >actual &&
71 test_cmp expect actual
75 test_expect_success
'moves and renames' '
77 git diff-tree three four -r --name-status -B -M | sort >actual &&
82 test_cmp expect actual