]>
Commit | Line | Data |
---|---|---|
368f99d5 JH |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2005 Junio C Hamano | |
4 | # | |
5 | ||
5be60078 | 6 | test_description='git ls-files test (--others should pick up symlinks). |
368f99d5 | 7 | |
5be60078 | 8 | This test runs git ls-files --others with the following on the |
368f99d5 JH |
9 | filesystem. |
10 | ||
11 | path0 - a file | |
12 | path1 - a symlink | |
13 | path2/file2 - a file in a directory | |
78c2cff6 JH |
14 | path3-junk - a file to confuse things |
15 | path3/file3 - a file in a directory | |
368f99d5 JH |
16 | ' |
17 | . ./test-lib.sh | |
18 | ||
19 | date >path0 | |
704a3143 JS |
20 | if test_have_prereq SYMLINKS |
21 | then | |
22 | ln -s xyzzy path1 | |
23 | else | |
24 | date > path1 | |
25 | fi | |
78c2cff6 | 26 | mkdir path2 path3 |
368f99d5 | 27 | date >path2/file2 |
78c2cff6 JH |
28 | date >path2-junk |
29 | date >path3/file3 | |
30 | date >path3-junk | |
5be60078 | 31 | git update-index --add path3-junk path3/file3 |
78c2cff6 JH |
32 | |
33 | cat >expected1 <<EOF | |
34 | expected1 | |
35 | expected2 | |
908bddab | 36 | output |
368f99d5 JH |
37 | path0 |
38 | path1 | |
78c2cff6 | 39 | path2-junk |
368f99d5 JH |
40 | path2/file2 |
41 | EOF | |
78c2cff6 JH |
42 | sed -e 's|path2/file2|path2/|' <expected1 >expected2 |
43 | ||
44 | test_expect_success \ | |
5be60078 JH |
45 | 'git ls-files --others to show output.' \ |
46 | 'git ls-files --others >output' | |
368f99d5 JH |
47 | |
48 | test_expect_success \ | |
5be60078 | 49 | 'git ls-files --others should pick up symlinks.' \ |
188c3827 | 50 | 'test_cmp expected1 output' |
78c2cff6 JH |
51 | |
52 | test_expect_success \ | |
5be60078 JH |
53 | 'git ls-files --others --directory to show output.' \ |
54 | 'git ls-files --others --directory >output' | |
78c2cff6 JH |
55 | |
56 | ||
57 | test_expect_success \ | |
5be60078 | 58 | 'git ls-files --others --directory should not get confused.' \ |
188c3827 | 59 | 'test_cmp expected2 output' |
78c2cff6 | 60 | |
368f99d5 | 61 | test_done |