Merge commit 'junio/next' into next
[git/platforms/storm.git] / t / t3000-ls-files-others.sh
blob1325465b5b1f93390d332efdf96094f34b497184
1 #!/bin/sh
3 # Copyright (c) 2005 Junio C Hamano
6 test_description='git ls-files test (--others should pick up symlinks).
8 This test runs git ls-files --others with the following on the
9 filesystem.
11 path0 - a file
12 path1 - a symlink
13 path2/file2 - a file in a directory
14 path3-junk - a file to confuse things
15 path3/file3 - a file in a directory
17 . ./test-lib.sh
19 date >path0
20 ln -s xyzzy path1
21 test "$no_symlinks" && date > path1
22 mkdir path2 path3
23 date >path2/file2
24 date >path2-junk
25 date >path3/file3
26 date >path3-junk
27 git update-index --add path3-junk path3/file3
29 cat >expected1 <<EOF
30 expected1
31 expected2
32 output
33 path0
34 path1
35 path2-junk
36 path2/file2
37 EOF
38 sed -e 's|path2/file2|path2/|' <expected1 >expected2
40 test_expect_success \
41 'git ls-files --others to show output.' \
42 'git ls-files --others >output'
44 test_expect_success \
45 'git ls-files --others should pick up symlinks.' \
46 'diff output expected1'
48 test_expect_success \
49 'git ls-files --others --directory to show output.' \
50 'git ls-files --others --directory >output'
53 test_expect_success \
54 'git ls-files --others --directory should not get confused.' \
55 'diff output expected2'
57 test_done