]>
Commit | Line | Data |
---|---|---|
500b97e4 FK |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2005 Junio C Hamano | |
4 | # | |
5 | ||
5be60078 | 6 | test_description='git ls-files test (-- to terminate the path list). |
500b97e4 | 7 | |
5be60078 | 8 | This test runs git ls-files --others with the following on the |
500b97e4 FK |
9 | filesystem. |
10 | ||
11 | path0 - a file | |
12 | -foo - a file with a funny name. | |
13 | -- - another file with a funny name. | |
14 | ' | |
15 | . ./test-lib.sh | |
16 | ||
17 | test_expect_success \ | |
18 | setup \ | |
19 | 'echo frotz >path0 && | |
20 | echo frotz >./-foo && | |
21 | echo frotz >./--' | |
22 | ||
23 | test_expect_success \ | |
5be60078 JH |
24 | 'git ls-files without path restriction.' \ |
25 | 'git ls-files --others >output && | |
3af82863 | 26 | test_cmp output - <<EOF |
500b97e4 FK |
27 | -- |
28 | -foo | |
29 | output | |
30 | path0 | |
31 | EOF | |
32 | ' | |
33 | ||
34 | test_expect_success \ | |
5be60078 JH |
35 | 'git ls-files with path restriction.' \ |
36 | 'git ls-files --others path0 >output && | |
3af82863 | 37 | test_cmp output - <<EOF |
500b97e4 FK |
38 | path0 |
39 | EOF | |
40 | ' | |
41 | ||
42 | test_expect_success \ | |
5be60078 JH |
43 | 'git ls-files with path restriction with --.' \ |
44 | 'git ls-files --others -- path0 >output && | |
3af82863 | 45 | test_cmp output - <<EOF |
500b97e4 FK |
46 | path0 |
47 | EOF | |
48 | ' | |
49 | ||
50 | test_expect_success \ | |
5be60078 JH |
51 | 'git ls-files with path restriction with -- --.' \ |
52 | 'git ls-files --others -- -- >output && | |
3af82863 | 53 | test_cmp output - <<EOF |
500b97e4 FK |
54 | -- |
55 | EOF | |
56 | ' | |
57 | ||
58 | test_expect_success \ | |
5be60078 JH |
59 | 'git ls-files with no path restriction.' \ |
60 | 'git ls-files --others -- >output && | |
3af82863 | 61 | test_cmp output - <<EOF |
500b97e4 FK |
62 | -- |
63 | -foo | |
64 | output | |
65 | path0 | |
66 | EOF | |
67 | ' | |
68 | ||
69 | test_done |