]> git.ipfire.org Git - thirdparty/git.git/blame - t/t6134-pathspec-in-submodule.sh
l10n: fr v2.23.0 round 2
[thirdparty/git.git] / t / t6134-pathspec-in-submodule.sh
CommitLineData
2d81c48f
SB
1#!/bin/sh
2
3test_description='test case exclude pathspec'
4
5. ./test-lib.sh
6
7test_expect_success 'setup a submodule' '
8 test_create_repo pretzel &&
9 : >pretzel/a &&
10 git -C pretzel add a &&
11 git -C pretzel commit -m "add a file" -- a &&
12 git submodule add ./pretzel sub &&
13 git commit -a -m "add submodule" &&
14 git submodule deinit --all
15'
16
17cat <<EOF >expect
18fatal: Pathspec 'sub/a' is in submodule 'sub'
19EOF
20
21test_expect_success 'error message for path inside submodule' '
22 echo a >sub/a &&
23 test_must_fail git add sub/a 2>actual &&
0d75bfe6 24 test_i18ncmp expect actual
2d81c48f
SB
25'
26
2d81c48f
SB
27test_expect_success 'error message for path inside submodule from within submodule' '
28 test_must_fail git -C sub add . 2>actual &&
bdab9721 29 test_i18ngrep "in unpopulated submodule" actual
2d81c48f
SB
30'
31
32test_done