aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Kaestle <peter@piie.net>2020-02-03 00:32:44 +0100
committerJunio C Hamano <gitster@pobox.com>2020-02-04 11:26:22 -0800
commitf38c92452d0ad75b1c5c5cfdd04223ad7a9a08a9 (patch)
treeb97a9cf42802d307a6ccf22ed242db090b6da6e6
parent3b2885ec9ba0b1328858231c9f5095e7f85d9f23 (diff)
downloadgit-f38c92452d0ad75b1c5c5cfdd04223ad7a9a08a9.tar.gz
t7400: testcase for submodule status on unregistered inner git repos
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: status should ignore the inner git-repo 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 the case 3) is not covered yet. Test that submodule status reports an inner git repo as unknown, while it is not added to the superproject. This covers case (3). Signed-off-by: Peter Kaestle <peter@piie.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t7400-submodule-basic.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index 86b424f634..e07afe90fc 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -55,6 +55,21 @@ test_expect_success 'add aborts on repository with no commits' '
test_i18ncmp expect actual
'
+test_expect_success 'status should ignore inner git repo when not added' '
+ rm -fr inner &&
+ mkdir inner &&
+ (
+ cd inner &&
+ git init &&
+ >t &&
+ git add t &&
+ git commit -m "initial"
+ ) &&
+ test_must_fail git submodule status inner 2>output.err &&
+ rm -fr inner &&
+ test_i18ngrep "^error: .*did not match any file(s) known to git" output.err
+'
+
test_expect_success 'setup - repository in init subdirectory' '
mkdir init &&
(