3 test_description
='basic ls-files tests
5 This test runs git ls-files with various unusual or malformed
6 command-line arguments.
9 TEST_PASSES_SANITIZE_LEAK
=true
12 test_expect_success
'ls-files in empty repository' '
13 git ls-files >actual &&
14 test_must_be_empty actual
17 test_expect_success
'ls-files with nonexistent path' '
18 git ls-files doesnotexist >actual &&
19 test_must_be_empty actual
22 test_expect_success
'ls-files with nonsense option' '
23 test_expect_code 129 git ls-files --nonsense 2>actual &&
24 test_i18ngrep "[Uu]sage: git ls-files" actual
27 test_expect_success
'ls-files -h in corrupt repository' '
33 test_expect_code 129 git ls-files -h >usage 2>&1
35 test_i18ngrep "[Uu]sage: git ls-files " broken/usage
38 test_expect_success SYMLINKS
'ls-files with absolute paths to symlinks' '
41 ln -s ../nosuch subs/link &&
42 git add link subs/link &&
43 git ls-files -s link subs/link >expect &&
44 git ls-files -s "$(pwd)/link" "$(pwd)/subs/link" >actual &&
45 test_cmp expect actual &&
49 git ls-files -s link >../expect &&
50 git ls-files -s "$(pwd)/link" >../actual
52 test_cmp expect actual