t3700: Skip a test with backslashes in pathspec
[git/dscho.git] / t / t3000-ls-files-others.sh
blobb7e03063161337248df90c6e88d2c06bf2377bd9
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 if test_have_prereq SYMLINKS
21 then
22 ln -s xyzzy path1
23 else
24 date > path1
26 mkdir path2 path3
27 date >path2/file2
28 date >path2-junk
29 date >path3/file3
30 date >path3-junk
31 git update-index --add path3-junk path3/file3
33 cat >expected1 <<EOF
34 expected1
35 expected2
36 output
37 path0
38 path1
39 path2-junk
40 path2/file2
41 EOF
42 sed -e 's|path2/file2|path2/|' <expected1 >expected2
44 test_expect_success \
45 'git ls-files --others to show output.' \
46 'git ls-files --others >output'
48 test_expect_success \
49 'git ls-files --others should pick up symlinks.' \
50 'test_cmp expected1 output'
52 test_expect_success \
53 'git ls-files --others --directory to show output.' \
54 'git ls-files --others --directory >output'
57 test_expect_success \
58 'git ls-files --others --directory should not get confused.' \
59 'test_cmp expected2 output'
61 test_done