]>
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 | |
20 | ln -s xyzzy path1 | |
78c2cff6 | 21 | mkdir path2 path3 |
368f99d5 | 22 | date >path2/file2 |
78c2cff6 JH |
23 | date >path2-junk |
24 | date >path3/file3 | |
25 | date >path3-junk | |
5be60078 | 26 | git update-index --add path3-junk path3/file3 |
78c2cff6 JH |
27 | |
28 | cat >expected1 <<EOF | |
29 | expected1 | |
30 | expected2 | |
908bddab | 31 | output |
368f99d5 JH |
32 | path0 |
33 | path1 | |
78c2cff6 | 34 | path2-junk |
368f99d5 JH |
35 | path2/file2 |
36 | EOF | |
78c2cff6 JH |
37 | sed -e 's|path2/file2|path2/|' <expected1 >expected2 |
38 | ||
39 | test_expect_success \ | |
5be60078 JH |
40 | 'git ls-files --others to show output.' \ |
41 | 'git ls-files --others >output' | |
368f99d5 JH |
42 | |
43 | test_expect_success \ | |
5be60078 | 44 | 'git ls-files --others should pick up symlinks.' \ |
78c2cff6 JH |
45 | 'diff output expected1' |
46 | ||
47 | test_expect_success \ | |
5be60078 JH |
48 | 'git ls-files --others --directory to show output.' \ |
49 | 'git ls-files --others --directory >output' | |
78c2cff6 JH |
50 | |
51 | ||
52 | test_expect_success \ | |
5be60078 | 53 | 'git ls-files --others --directory should not get confused.' \ |
78c2cff6 JH |
54 | 'diff output expected2' |
55 | ||
368f99d5 | 56 | test_done |