Merge branch 'dl/format-patch-cover-from-desc'
[git.git] / t / t6134-pathspec-in-submodule.sh
blobc670668409817c6d1066de53dc294bade2f27e93
1 #!/bin/sh
3 test_description='test case exclude pathspec'
5 . ./test-lib.sh
7 test_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
17 cat <<EOF >expect
18 fatal: Pathspec 'sub/a' is in submodule 'sub'
19 EOF
21 test_expect_success 'error message for path inside submodule' '
22 echo a >sub/a &&
23 test_must_fail git add sub/a 2>actual &&
24 test_i18ncmp expect actual
27 test_expect_success 'error message for path inside submodule from within submodule' '
28 test_must_fail git -C sub add . 2>actual &&
29 test_i18ngrep "in unpopulated submodule" actual
32 test_done