git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 0/2] submodule config test cleanup
@ 2016-12-27 19:36 Stefan Beller
  2016-12-27 19:36 ` [PATCH 1/2] t7411: quote URLs Stefan Beller
  2016-12-27 19:36 ` [PATCH 2/2] t7411: test lookup of uninitialized submodules Stefan Beller
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Beller @ 2016-12-27 19:36 UTC (permalink / raw)
  To: gitster; +Cc: git, Stefan Beller

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] t7411: quote URLs
  2016-12-27 19:36 [PATCH 0/2] submodule config test cleanup Stefan Beller
@ 2016-12-27 19:36 ` Stefan Beller
  2016-12-27 19:36 ` [PATCH 2/2] t7411: test lookup of uninitialized submodules Stefan Beller
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Beller @ 2016-12-27 19:36 UTC (permalink / raw)
  To: gitster; +Cc: git, Stefan Beller

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] t7411: test lookup of uninitialized submodules
  2016-12-27 19:36 [PATCH 0/2] submodule config test cleanup Stefan Beller
  2016-12-27 19:36 ` [PATCH 1/2] t7411: quote URLs Stefan Beller
@ 2016-12-27 19:36 ` Stefan Beller
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Beller @ 2016-12-27 19:36 UTC (permalink / raw)
  To: gitster; +Cc: git, Stefan Beller

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-27 19:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-27 19:36 [PATCH 0/2] submodule config test cleanup Stefan Beller
2016-12-27 19:36 ` [PATCH 1/2] t7411: quote URLs Stefan Beller
2016-12-27 19:36 ` [PATCH 2/2] t7411: test lookup of uninitialized submodules Stefan Beller

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).