Stefan Beller | 2d81c48 | 2017-01-09 15:16:50 -0800 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='test case exclude pathspec' |
| 4 | |
| 5 | . ./test-lib.sh |
| 6 | |
| 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 |
| 15 | ' |
| 16 | |
| 17 | cat <<EOF >expect |
| 18 | fatal: Pathspec 'sub/a' is in submodule 'sub' |
| 19 | EOF |
| 20 | |
| 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 && |
Ævar Arnfjörð Bjarmason | 0d75bfe | 2017-05-05 18:19:32 +0000 | [diff] [blame] | 24 | test_i18ncmp expect actual |
Stefan Beller | 2d81c48 | 2017-01-09 15:16:50 -0800 | [diff] [blame] | 25 | ' |
| 26 | |
Stefan Beller | 2d81c48 | 2017-01-09 15:16:50 -0800 | [diff] [blame] | 27 | test_expect_success 'error message for path inside submodule from within submodule' ' |
| 28 | test_must_fail git -C sub add . 2>actual && |
Brandon Williams | bdab972 | 2017-05-09 12:17:59 -0700 | [diff] [blame] | 29 | test_i18ngrep "in unpopulated submodule" actual |
Stefan Beller | 2d81c48 | 2017-01-09 15:16:50 -0800 | [diff] [blame] | 30 | ' |
| 31 | |
| 32 | test_done |