diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-09-11 11:08:55 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-09-11 11:08:55 -0700 |
commit | fe31b2afac2fbae25086ecd00a1f57bcd74e9148 (patch) | |
tree | a8cd92a66b66bb3e351254c86b61f67ac5361806 /t | |
parent | ef66ac3ead836c272b20550b09dad7def6084560 (diff) | |
parent | be9d0a3a4cbd736911afc10154c7a541129503bd (diff) | |
download | git-fe31b2afac2fbae25086ecd00a1f57bcd74e9148.tar.gz git-fe31b2afac2fbae25086ecd00a1f57bcd74e9148.tar.xz |
Merge branch 'hv/submodule-path-unmatch' into maint-1.7.11
* hv/submodule-path-unmatch:
Let submodule command exit with error status if path does not exist
Diffstat (limited to 't')
-rwxr-xr-x | t/t7400-submodule-basic.sh | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh index 81827e696..0278f4839 100755 --- a/t/t7400-submodule-basic.sh +++ b/t/t7400-submodule-basic.sh @@ -258,6 +258,27 @@ test_expect_success 'init should register submodule url in .git/config' ' test_cmp expect url ' +test_failure_with_unknown_submodule () { + test_must_fail git submodule $1 no-such-submodule 2>output.err && + grep "^error: .*no-such-submodule" output.err +} + +test_expect_success 'init should fail with unknown submodule' ' + test_failure_with_unknown_submodule init +' + +test_expect_success 'update should fail with unknown submodule' ' + test_failure_with_unknown_submodule update +' + +test_expect_success 'status should fail with unknown submodule' ' + test_failure_with_unknown_submodule status +' + +test_expect_success 'sync should fail with unknown submodule' ' + test_failure_with_unknown_submodule sync +' + test_expect_success 'update should fail when path is used by a file' ' echo hello >expect && @@ -418,10 +439,7 @@ test_expect_success 'moving to a commit without submodule does not leave empty d ' test_expect_success 'submodule <invalid-path> warns' ' - - git submodule no-such-submodule 2> output.err && - grep "^error: .*no-such-submodule" output.err - + test_failure_with_unknown_submodule ' test_expect_success 'add submodules without specifying an explicit path' ' |