3 test_description
='ls-files tests with relative paths
5 This test runs git ls-files with various relative path arguments.
8 TEST_PASSES_SANITIZE_LEAK
=true
11 test_expect_success
'prepare' '
13 git add never-mind-me &&
18 x="x xa xbc xdef xghij xklmno" &&
19 y=$(echo "$x" | tr x y) &&
27 test_expect_success
'ls-files with mixed levels' '
34 git ls-files $(cat expect) >actual &&
35 test_cmp expect actual
39 test_expect_success
'ls-files -c' '
42 printf "error: pathspec $SQ%s$SQ did not match any file(s) known to git\n" ../y* >expect.err &&
43 echo "Did you forget to ${SQ}git add${SQ}?" >>expect.err &&
44 ls ../x* >expect.out &&
45 test_must_fail git ls-files -c --error-unmatch ../[xy]* >actual.out 2>actual.err &&
46 test_cmp expect.out actual.out &&
47 test_cmp expect.err actual.err
51 test_expect_success
'ls-files -o' '
54 printf "error: pathspec $SQ%s$SQ did not match any file(s) known to git\n" ../x* >expect.err &&
55 echo "Did you forget to ${SQ}git add${SQ}?" >>expect.err &&
56 ls ../y* >expect.out &&
57 test_must_fail git ls-files -o --error-unmatch ../[xy]* >actual.out 2>actual.err &&
58 test_cmp expect.out actual.out &&
59 test_cmp expect.err actual.err