]>
git.ipfire.org Git - thirdparty/git.git/blob - t/t3005-ls-files-relative.sh
db13aabf625b3aa26f4b5ca3dc2cf86f623c4e51
3 test_description
='ls-files tests with relative paths
5 This test runs git ls-files with various relative path arguments.
10 test_expect_success
'prepare' '
12 git add never-mind-me &&
17 x="x xa xbc xdef xghij xklmno" &&
18 y=$(echo "$x" | tr x y) &&
26 test_expect_success
'ls-files with mixed levels' '
33 git ls-files $(cat expect) >actual &&
34 test_cmp expect actual
38 test_expect_success
'ls-files -c' '
41 printf "error: pathspec $SQ%s$SQ did not match any file(s) known to git\n" ../y* >expect.err &&
42 echo "Did you forget to ${SQ}git add${SQ}?" >>expect.err &&
43 ls ../x* >expect.out &&
44 test_must_fail git ls-files -c --error-unmatch ../[xy]* >actual.out 2>actual.err &&
45 test_cmp expect.out actual.out &&
46 test_cmp expect.err actual.err
50 test_expect_success
'ls-files -o' '
53 printf "error: pathspec $SQ%s$SQ did not match any file(s) known to git\n" ../x* >expect.err &&
54 echo "Did you forget to ${SQ}git add${SQ}?" >>expect.err &&
55 ls ../y* >expect.out &&
56 test_must_fail git ls-files -o --error-unmatch ../[xy]* >actual.out 2>actual.err &&
57 test_cmp expect.out actual.out &&
58 test_cmp expect.err actual.err