git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Peter Kaestle <peter@piie.net>
To: gitster@pobox.com
Cc: christian.couder@gmail.com, git@vger.kernel.org,
	pc44800@gmail.com, peter.kaestle@nokia.com,
	Peter Kaestle <peter@piie.net>
Subject: [PATCH] t7400: testcase for submodule status on unregistered inner git repos
Date: Mon,  3 Feb 2020 00:32:44 +0100	[thread overview]
Message-ID: <20200202233244.199040-1-peter@piie.net> (raw)
In-Reply-To: <xmqqzhe8bwab.fsf@gitster-ct.c.googlers.com>

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>
---
 t/t7400-submodule-basic.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index 29dc6812f1..d926b8c772 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 &&
 	(
-- 
2.25.0


  parent reply	other threads:[~2020-02-02 23:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-14 14:02 [PATCH] Fix submodule status of dirs initialized but empty Peter Kästle
2020-01-21 10:12 ` [PATCH v2] Fix status of initialized but not cloned submodules Peter Kaestle
2020-01-23 21:12   ` Junio C Hamano
2020-01-24 10:34     ` [PATCH v3 1/2] Testcase for submodule status on empty dirs Peter Kaestle
2020-01-24 10:34       ` [PATCH v3 2/2] Fix status of initialized but not cloned submodules Peter Kaestle
2020-01-24 17:35       ` [PATCH v3 1/2] Testcase for submodule status on empty dirs Junio C Hamano
2020-01-27  9:06         ` [PATCH v4 1/2] t7400: add a testcase " Peter Kaestle
2020-01-27  9:06           ` [PATCH v4 2/2] Fix status of initialized but not cloned submodules Peter Kaestle
2020-01-27 18:15           ` [PATCH v4 1/2] t7400: add a testcase for submodule status on empty dirs Junio C Hamano
2020-01-28  8:16             ` Peter Kästle
2020-02-02 23:32             ` Peter Kaestle [this message]
2020-01-24 11:55     ` [PATCH v2] Fix status of initialized but not cloned submodules Peter Kästle
2020-01-24 17:16       ` Junio C Hamano
2020-01-27  8:52         ` Peter Kästle
2020-01-27 18:18           ` Junio C Hamano
2020-02-02 23:16         ` Peter Kästle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200202233244.199040-1-peter@piie.net \
    --to=peter@piie.net \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pc44800@gmail.com \
    --cc=peter.kaestle@nokia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).