3 test_description='basic ls-files tests
5 This test runs git ls-files with various unusual or malformed
6 command-line arguments.
13 test_expect_success 'ls-files in empty repository' '
14 git ls-files >actual &&
18 test_expect_success 'ls-files with nonexistent path' '
19 git ls-files doesnotexist >actual &&
23 test_expect_success 'ls-files with nonsense option' '
24 test_expect_code 129 git ls-files --nonsense 2>actual &&
25 test_i18ngrep "[Uu]sage: git ls-files" actual
28 test_expect_success 'ls-files -h in corrupt repository' '
34 test_expect_code 129 git ls-files -h >usage 2>&1
36 test_i18ngrep "[Uu]sage: git ls-files " broken/usage
39 test_expect_success SYMLINKS 'ls-files with absolute paths to symlinks' '
42 ln -s ../nosuch subs/link &&
43 git add link subs/link &&
44 git ls-files -s link subs/link >expect &&
45 git ls-files -s "$(pwd)/link" "$(pwd)/subs/link" >actual &&
46 test_cmp expect actual &&
50 git ls-files -s link >../expect &&
51 git ls-files -s "$(pwd)/link" >../actual
53 test_cmp expect actual