# [PATCH 0/2] submodule config test cleanup

3 messages from 2016-12-27 to 2016-12-27. Participants: Stefan Beller.
Thread: https://gitlist.dev/t/44774

## Stefan Beller, 2016-12-27 19:36

Subject: [PATCH 0/2] submodule config test cleanup
Message-ID: <20161227193605.12413-1-sbeller@google.com>
URL: https://gitlist.dev/e/20161227193605.12413-1-sbeller%40google.com

```
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, 2016-12-27 19:36

Subject: [PATCH 1/2] t7411: quote URLs
Message-ID: <20161227193605.12413-2-sbeller@google.com>
URL: https://gitlist.dev/e/20161227193605.12413-2-sbeller%40google.com
In-Reply-To: <20161227193605.12413-1-sbeller@google.com>

```
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(-)

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, 2016-12-27 19:36

Subject: [PATCH 2/2] t7411: test lookup of uninitialized submodules
Message-ID: <20161227193605.12413-3-sbeller@google.com>
URL: https://gitlist.dev/e/20161227193605.12413-3-sbeller%40google.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


```
