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

[PATCH v3 3/4] submodule: verify support for superproject URLs of the form foo/bar.

From
Jon Seymour <jon.seymour@gmail.com>
Date
May 21, 2012, 13:31 UTC
Message-ID
<1337607102-14737-3-git-send-email-jon.seymour@gmail.com>
In-Reply-To
<1337607102-14737-1-git-send-email-jon.seymour@gmail.com>

This test shows that git submodule add produces the wrong submodule URL when the origin URL of the superproject is of the form: foo/bar.

The problem is fixed by a subsequent patch.
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
---
 t/t7400-submodule-basic.sh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index b838f43..71f30d8 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -533,6 +533,23 @@ test_expect_sucess 'test that submodule add creates the correct url when super o
 		test "$(git config submodule.sub.url)" = ../../relative/subrepo
 	)
 '
+test_expect_failure 'test that submodule add creates the correct url when super origin url is relative/repo' '
+	mkdir reladd &&
+	(
+		cd reladd &&
+		git init &&
+		git remote add origin relative/repo
+		mkdir sub &&
+		(
+			cd sub &&
+			git init &&
+			test_commit foo
+		) &&
+		git submodule add ../subrepo ./sub &&
+		test "$(git config submodule.sub.url)" = ../relative/subrepo
+	)
+'
+
 test_expect_success 'moving the superproject does not break submodules' '
 	(
 		cd addtest &&
-- 
1.7.10.2.594.g5c52315
Previous: Jon SeymourNext: Jon Seymour
Message 5 of 6 in “submodule: verify support for superproject origin URLs of the form ./foo/bar or ../foo/bar”
  1. 1/4 submodule: verify support for superproject origin URLs of the form ./foo/bar or ../foo/barJon Seymour, May 21, 2012
  2. 2/4 submodule: support superproject origin URLs of the form ./foo/bar or ../foo/barJon Seymour, May 21, 2012
  3. Jon SeymourMay 21, 2012
  4. Jon SeymourMay 21, 2012
  5. 3/4 submodule: verify support for superproject URLs of the form foo/bar.Jon Seymour, May 21, 2012
  6. 4/4 submodule: support superproject origin URLs of the form foo/barJon Seymour, May 21, 2012

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.