]> git.ipfire.org Git - thirdparty/git.git/blame - t/t6134-pathspec-in-submodule.sh
Sync with Git 2.45.1
[thirdparty/git.git] / t / t6134-pathspec-in-submodule.sh
CommitLineData
2d81c48f
SB
1#!/bin/sh
2
3test_description='test case exclude pathspec'
4
87a68348 5TEST_PASSES_SANITIZE_LEAK=true
2d81c48f
SB
6. ./test-lib.sh
7
8test_expect_success 'setup a submodule' '
9 test_create_repo pretzel &&
10 : >pretzel/a &&
11 git -C pretzel add a &&
12 git -C pretzel commit -m "add a file" -- a &&
0f21b8f4 13 git -c protocol.file.allow=always submodule add ./pretzel sub &&
2d81c48f
SB
14 git commit -a -m "add submodule" &&
15 git submodule deinit --all
16'
17
18cat <<EOF >expect
19fatal: Pathspec 'sub/a' is in submodule 'sub'
20EOF
21
22test_expect_success 'error message for path inside submodule' '
23 echo a >sub/a &&
24 test_must_fail git add sub/a 2>actual &&
1108cea7 25 test_cmp expect actual
2d81c48f
SB
26'
27
2d81c48f
SB
28test_expect_success 'error message for path inside submodule from within submodule' '
29 test_must_fail git -C sub add . 2>actual &&
6789275d 30 test_grep "in unpopulated submodule" actual
2d81c48f
SB
31'
32
33test_done