Skip to content

Commit ace912b

Browse files
Peter Kaestlegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a7312d1 commit ace912b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

t/t7400-submodule-basic.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,14 @@ test_expect_success 'init should register submodule url in .git/config' '
377377
test_cmp expect url
378378
'
379379

380+
test_expect_failure 'status should still be "missing" after initializing' '
381+
rm -fr init &&
382+
mkdir init &&
383+
git submodule status >lines &&
384+
rm -fr init &&
385+
grep "^-$rev1" lines
386+
'
387+
380388
test_failure_with_unknown_submodule () {
381389
test_must_fail git submodule $1 no-such-submodule 2>output.err &&
382390
test_i18ngrep "^error: .*no-such-submodule" output.err

0 commit comments

Comments
 (0)