threads / patch / 44774

patch, 2 partssubmodule config test cleanup

Subject: [PATCH 0/2] submodule config test cleanup

## tl;dr

3 messages between Dec 27, 2016 and Dec 27, 2016. Diffs are folded; open one to read it.

replies: 2people: 1as markdown or json

Stefan Beller· Dec 27, 2016, 19:36 UTC · lore
A test cleanup and an additional test for the submodule configuration.
Stefan Beller (2):
  t7411: quote URLs
  t7411: test lookup of uninitialized submodules
 t/t7411-submodule-config.sh | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)
-- 
2.11.0.rc2.50.g8bda6b2.dirty
Stefan Beller· Dec 27, 2016, 19:36 UTC · re: Stefan Beller · lore

[PATCH 1/2] t7411: quote URLs

The variables may contain white spaces, so we need to quote them. By not quoting the variables we'd end up passing multiple arguments to git config, which doesn't fail for two arguments as value.

Signed-off-by: Stefan Beller <sbeller@google.com>
---
 t/t7411-submodule-config.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Show changes to t/t7411-submodule-config.sh +2 −2
diff --git a/t/t7411-submodule-config.sh b/t/t7411-submodule-config.sh
index 47562ce465..3646f28b40 100755
--- a/t/t7411-submodule-config.sh
+++ b/t/t7411-submodule-config.sh
@@ -120,8 +120,8 @@ test_expect_success 'reading of local configuration' '
 			"" submodule \
 				>actual &&
 		test_cmp expect_local_path actual &&
-		git config submodule.a.url $old_a &&
-		git config submodule.submodule.url $old_submodule &&
+		git config submodule.a.url "$old_a" &&
+		git config submodule.submodule.url "$old_submodule" &&
 		git config --unset submodule.a.path c
 	)
 '
-- 
2.11.0.rc2.50.g8bda6b2.dirty
Stefan Beller· Dec 27, 2016, 19:36 UTC · re: Stefan Beller · lore

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

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(+)
Show changes to t/t7411-submodule-config.sh +21 −0
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

← back to recent threads