3 # Copyright (c) 2005 Junio C Hamano
6 test_description
='git ls-files test (-- to terminate the path list).
8 This test runs git ls-files --others with the following on the
12 -foo - a file with a funny name.
13 -- - another file with a funny name.
16 TEST_PASSES_SANITIZE_LEAK
=true
19 test_expect_success
'setup' '
25 test_expect_success
'git ls-files without path restriction.' '
26 test_when_finished "rm -f expect" &&
27 git ls-files --others >output &&
28 cat >expect <<-\EOF &&
34 test_cmp output expect
37 test_expect_success
'git ls-files with path restriction.' '
38 test_when_finished "rm -f expect" &&
39 git ls-files --others path0 >output &&
40 cat >expect <<-\EOF &&
43 test_cmp output expect
46 test_expect_success
'git ls-files with path restriction with --.' '
47 test_when_finished "rm -f expect" &&
48 git ls-files --others -- path0 >output &&
49 cat >expect <<-\EOF &&
52 test_cmp output expect
55 test_expect_success
'git ls-files with path restriction with -- --.' '
56 test_when_finished "rm -f expect" &&
57 git ls-files --others -- -- >output &&
58 cat >expect <<-\EOF &&
61 test_cmp output expect
64 test_expect_success
'git ls-files with no path restriction.' '
65 test_when_finished "rm -f expect" &&
66 git ls-files --others -- >output &&
67 cat >expect <<-\EOF &&
73 test_cmp output expect