summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-08-29 14:50:15 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-08-29 14:50:15 -0700
commit1c0fa76be7d7417080a36f8603c7e9c2511509ea (patch)
tree26907418b8d05c20a5e956b85b324cfb8b841c79 /t
parentMerge branch 'jc/capabilities' (diff)
parentLet submodule command exit with error status if path does not exist (diff)
downloadtgif-1c0fa76be7d7417080a36f8603c7e9c2511509ea.tar.xz
Merge branch 'hv/submodule-path-unmatch'
* hv/submodule-path-unmatch: Let submodule command exit with error status if path does not exist
Diffstat (limited to 't')
-rwxr-xr-xt/t7400-submodule-basic.sh26
1 files changed, 22 insertions, 4 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index c73bec9551..56a81cd748 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' '