3 test_description='typechange rename detection'
7 if ! test_have_prereq SYMLINKS
9 say 'Symbolic links not supported, skipping tests.'
14 test_expect_success setup '
17 cat "$TEST_DIRECTORY"/../COPYING >foo &&
20 git commit -a -m Initial &&
24 cat "$TEST_DIRECTORY"/../COPYING >bar &&
27 git commit -a -m Second &&
31 cat "$TEST_DIRECTORY"/../COPYING >foo &&
33 git commit -a -m Third &&
39 git commit -a -m Fourth &&
42 # This is purely for sanity check
45 cat "$TEST_DIRECTORY"/../COPYING >foo &&
46 cat "$TEST_DIRECTORY"/../Makefile >bar &&
48 git commit -a -m Fifth &&
52 cat "$TEST_DIRECTORY"/../Makefile >foo &&
53 cat "$TEST_DIRECTORY"/../COPYING >bar &&
55 git commit -a -m Sixth &&
60 test_expect_success 'cross renames to be detected for regular files' '
62 git diff-tree five six -r --name-status -B -M | sort >actual &&
67 test_cmp expect actual
71 test_expect_success 'cross renames to be detected for typechange' '
73 git diff-tree one two -r --name-status -B -M | sort >actual &&
78 test_cmp expect actual
82 test_expect_success 'moves and renames' '
84 git diff-tree three four -r --name-status -B -M | sort >actual &&
89 test_cmp expect actual