3 # Copyright (c) 2005 Junio C Hamano
6 test_description
='git ls-files -k and -m flags test.
8 This test prepares the following in the cache:
12 path2/file2 - a file in a directory
13 path3/file3 - a file in a directory
15 and the following on the filesystem:
17 path0/file0 - a file in a directory
18 path1/file1 - a file in a directory
23 path6/file6 - a file in a directory
25 git ls-files -k should report that existing filesystem
26 objects except path4, path5 and path6/file6 to be killed.
28 Also for modification test, the cache and working tree have:
30 path7 - an empty file, modified to a non-empty file.
31 path8 - a non-empty file, modified to an empty file.
32 path9 - an empty file, cache dirtied.
33 path10 - a non-empty file, cache dirtied.
35 We should report path0, path1, path2/file2, path3/file3, path7 and path8
36 modified without reporting path9 and path10.
41 if test_have_prereq SYMLINKS
55 'git update-index --add to add various paths.' \
56 "git update-index --add -- path0 path1 path?/file? path7 path8 path9 path10"
58 rm -fr path?
;# leave path10 alone
60 if test_have_prereq SYMLINKS
68 mkdir path0 path1 path6
78 'git ls-files -k to show killed files.' \
79 'git ls-files -k >.output'
88 'validate git ls-files -k output.' \
89 'test_cmp .expected .output'
92 'git ls-files -m to show modified files.' \
93 'git ls-files -m >.output'
103 test_expect_success \
104 'validate git ls-files -m output.' \
105 'test_cmp .expected .output'