]> git.ipfire.org Git - thirdparty/git.git/blame - t/t3004-ls-files-basic.sh
Fix tests under GETTEXT_POISON on parseopt
[thirdparty/git.git] / t / t3004-ls-files-basic.sh
CommitLineData
cbb3167e
NTND
1#!/bin/sh
2
3test_description='basic ls-files tests
4
5This test runs git ls-files with various unusual or malformed
6command-line arguments.
7'
8
9. ./test-lib.sh
10
11>empty
12
13test_expect_success 'ls-files in empty repository' '
14 git ls-files >actual &&
15 test_cmp empty actual
16'
17
18test_expect_success 'ls-files with nonexistent path' '
19 git ls-files doesnotexist >actual &&
20 test_cmp empty actual
21'
22
23test_expect_success 'ls-files with nonsense option' '
24 test_expect_code 129 git ls-files --nonsense 2>actual &&
9a001381 25 test_i18ngrep "[Uu]sage: git ls-files" actual
cbb3167e
NTND
26'
27
28test_expect_success 'ls-files -h in corrupt repository' '
29 mkdir broken &&
30 (
31 cd broken &&
32 git init &&
33 >.git/index &&
34 test_expect_code 129 git ls-files -h >usage 2>&1
35 ) &&
9a001381 36 test_i18ngrep "[Uu]sage: git ls-files " broken/usage
cbb3167e
NTND
37'
38
39test_done