diff mbox series

[v4,1/2] t7400: add a testcase for submodule status on empty dirs

Message ID 1580115989-32649-1-git-send-email-peter.kaestle@nokia.com (mailing list archive)
State New, archived
Headers show
Series [v4,1/2] t7400: add a testcase for submodule status on empty dirs | expand

Commit Message

Peter Kaestle Jan. 27, 2020, 9:06 a.m. UTC
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

Case 2) will be covered by this patch.  Case 3) remains uncovered.

Test that submodule status reports initialized but not cloned
submodules as missing to fill the gap in test coverage.

Signed-off-by: Peter Kaestle <peter.kaestle@nokia.com>
---
 t/t7400-submodule-basic.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Junio C Hamano Jan. 27, 2020, 6:15 p.m. UTC | #1
Peter Kaestle <peter.kaestle@nokia.com> writes:

> 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
>
> Case 2) will be covered by this patch.  Case 3) remains uncovered.
>
> Test that submodule status reports initialized but not cloned
> submodules as missing to fill the gap in test coverage.

Thanks for an update.
Peter Kaestle Jan. 28, 2020, 8:16 a.m. UTC | #2
Hi Junio,

On 27.01.20 19:15, Junio C Hamano wrote:
> Peter Kaestle <peter.kaestle@nokia.com> writes:
> 
>> 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
>>
>> Case 2) will be covered by this patch.  Case 3) remains uncovered.
>>
>> Test that submodule status reports initialized but not cloned
>> submodules as missing to fill the gap in test coverage.
> 
> Thanks for an update.
> 

Sure, welcome.  Will you include those patches, or do you need further 
refinement?
- Thanks a lot for your guidance and mentoring.  It was a pleasure to 
learn from you.
diff mbox series

Patch

diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index 7f75bb1..2e84914 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -399,6 +399,14 @@  test_expect_success 'init should register submodule url in .git/config' '
 	test_cmp expect url
 '
 
+test_expect_success '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