path: root/t
diff options
authorPeter Kaestle <>2020-01-24 10:34:03 (GMT)
committerJunio C Hamano <>2020-01-27 18:13:32 (GMT)
commitace912bfb8e0cf85e29cc2d81fd847a96637be36 (patch)
treef03a53a96b9997690a1eca78fc19a730136e9b90 /t
parenta7312d1a28ff3ab0a5a5427b35f01d943103cba8 (diff)
t7400: add a testcase for submodule status on empty dirs
We have test coverage for "git submodule status" output in various cases, i.e. 1) not-init, not-cloned: status should initially be "missing" 2) init, not-cloned: status should be "missing" 3) not-init, cloned: 4) init, cloned: status should be "up-to-date" after update 4.1) + modified: status should be "modified" after submodule commit 4.2) + modified, committed: status should be "up-to-date" after update but the cases 2) and 3) are not covered. Test that submodule status reports initialized but not cloned submodules as missing to fill the gap in test coverage; this covers case (2) above, but case (3) remains uncovered. Signed-off-by: Peter Kaestle <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't')
1 files changed, 8 insertions, 0 deletions
diff --git a/t/ b/t/
index a208cb2..5c9acb8 100755
--- a/t/
+++ b/t/
@@ -377,6 +377,14 @@ test_expect_success 'init should register submodule url in .git/config' '
test_cmp expect url
+test_expect_failure 'status should still be "missing" after initializing' '
+ rm -fr init &&
+ mkdir init &&
+ git submodule status >lines &&
+ rm -fr init &&
+ grep "^-$rev1" lines
test_failure_with_unknown_submodule () {
test_must_fail git submodule $1 no-such-submodule 2>output.err &&
test_i18ngrep "^error: .*no-such-submodule" output.err