git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] t7411: test lookup of uninitialized submodules

From
Stefan Beller <sbeller@google.com>
Date
Dec 27, 2016, 19:36 UTC
Message-ID
<20161227193605.12413-3-sbeller@google.com>
In-Reply-To
<20161227193605.12413-1-sbeller@google.com>

Sometimes we need to lookup information of uninitialized submodules. Make sure that works.

Signed-off-by: Stefan Beller <sbeller@google.com>
---
 t/t7411-submodule-config.sh | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
diff --git a/t/t7411-submodule-config.sh b/t/t7411-submodule-config.sh
index 3646f28b40..b40df6a4c1 100755
--- a/t/t7411-submodule-config.sh
+++ b/t/t7411-submodule-config.sh
@@ -126,6 +126,27 @@ test_expect_success 'reading of local configuration' '
 	)
 '
 
+cat >super/expect_url <<EOF
+Submodule url: '../submodule' for path 'b'
+Submodule url: 'git@somewhere.else.net:submodule.git' for path 'submodule'
+EOF
+
+test_expect_success 'reading of local configuration for uninitialized submodules' '
+	(
+		cd super &&
+		git submodule deinit -f b &&
+		old_submodule=$(git config submodule.submodule.url) &&
+		git config submodule.submodule.url git@somewhere.else.net:submodule.git &&
+		test-submodule-config --url \
+			"" b \
+			"" submodule \
+				>actual &&
+		test_cmp expect_url actual &&
+		git config submodule.submodule.url "$old_submodule" &&
+		git submodule init b
+	)
+'
+
 cat >super/expect_fetchrecurse_die.err <<EOF
 fatal: bad submodule.submodule.fetchrecursesubmodules argument: blabla
 EOF
-- 
2.11.0.rc2.50.g8bda6b2.dirty
Previous: Stefan Beller
Message 3 of 3 in “submodule config test cleanup”
  1. 0/2 submodule config test cleanupStefan Beller, Dec 27, 2016
  2. 1/2 t7411: quote URLsStefan Beller, Dec 27, 2016
  3. 2/2 t7411: test lookup of uninitialized submodulesStefan Beller, Dec 27, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.