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

[PATCH 2/5] t5550: break submodule config test into multiple sub-tests

From
Jeff King <peff@peff.net>
Date
Apr 28, 2016, 13:37 UTC
Message-ID
<20160428133704.GB25319@sigill.intra.peff.net>
In-Reply-To
<20160428133534.GA19056@sigill.intra.peff.net>

Right now we test only the cloning case, but there are other interesting cases (e.g., fetching). Let's pull the setup bits into their own test, which will make things flow more logically once we start adding more tests which use the setup.

Let's also introduce some whitespace to the clone-test to split the two parts: making sure it fails without our cmdline config, and that it succeeds with it.

Signed-off-by: Jeff King <peff@peff.net>
---
 t/t5550-http-fetch-dumb.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh
index 81cc57f..e8e91bb 100755
--- a/t/t5550-http-fetch-dumb.sh
+++ b/t/t5550-http-fetch-dumb.sh
@@ -91,17 +91,21 @@ test_expect_success 'configured username does not override URL' '
 	expect_askpass pass user@host
 '
 
-test_expect_success 'cmdline credential config passes into submodules' '
+test_expect_success 'set up repo with http submodules' '
 	git init super &&
 	set_askpass user@host pass@host &&
 	(
 		cd super &&
 		git submodule add "$HTTPD_URL/auth/dumb/repo.git" sub &&
 		git commit -m "add submodule"
-	) &&
+	)
+'
+
+test_expect_success 'cmdline credential config passes to submodule via clone' '
 	set_askpass wrong pass@host &&
 	test_must_fail git clone --recursive super super-clone &&
 	rm -rf super-clone &&
+
 	set_askpass wrong pass@host &&
 	git -c "credential.$HTTPD_URL.username=user@host" \
 		clone --recursive super super-clone &&
-- 
2.8.1.617.gbdccc2d
Previous: Jacob KellerNext: Stefan Beller
Message 15 of 36 in “[RFC] How to pass Git config command line instructions to Submodule commands?”
  1. Lars SchneiderApr 25, 2016
  2. Stefan BellerApr 25, 2016
  3. Jacob KellerApr 25, 2016
  4. Jeff KingApr 25, 2016
  5. Jeff KingApr 25, 2016
  6. Lars SchneiderApr 28, 2016
  7. Jeff KingApr 28, 2016
  8. Jeff KingApr 28, 2016
  9. Jeff KingApr 28, 2016
  10. 0/5 fixes for sanitized submodule configJeff King, Apr 28, 2016
  11. 1/5 t5550: fix typo in $HTTPD_URLJeff King, Apr 28, 2016
  12. Jacob KellerApr 28, 2016
  13. Jeff KingApr 28, 2016
  14. Jacob KellerApr 28, 2016
  15. 2/5 t5550: break submodule config test into multiple sub-testsJeff King, Apr 28, 2016
  16. Stefan BellerApr 28, 2016
  17. Jeff KingApr 28, 2016
  18. Jacob KellerApr 28, 2016
  19. 3/5 submodule: export sanitized GIT_CONFIG_PARAMETERSJeff King, Apr 28, 2016
  20. Stefan BellerApr 28, 2016
  21. Jeff KingApr 28, 2016
  22. Stefan BellerApr 28, 2016
  23. Johannes SchindelinApr 28, 2016
  24. Jacob KellerApr 28, 2016
  25. Jeff KingApr 28, 2016
  26. Jacob KellerApr 28, 2016
  27. 4/5 submodule--helper: move config-sanitizing to submodule.cJeff King, Apr 28, 2016
  28. Stefan BellerApr 28, 2016
  29. Jeff KingApr 28, 2016
  30. Lars SchneiderApr 28, 2016
  31. 5/5 submodule: use prepare_submodule_repo_env consistentlyJeff King, Apr 28, 2016
  32. Johannes SchindelinApr 28, 2016
  33. Stefan BellerApr 28, 2016
  34. Jacob KellerApr 28, 2016
  35. Lars SchneiderApr 28, 2016
  36. Jeff KingApr 28, 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.