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

[PATCH 1/2] submodule: add tests for add,sync,init in presence of relative super origin URL

From
Jon Seymour <jon.seymour@gmail.com>
Date
May 19, 2012, 04:40 UTC
Message-ID
<1337402403-7546-1-git-send-email-jon.seymour@gmail.com>
These tests are expected to fail, pending subsequent patch.
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
---
 t/t7400-submodule-basic.sh | 27 +++++++++++++++++++++++++++
 t/t7403-submodule-sync.sh  | 10 ++++++++++
 2 files changed, 37 insertions(+)
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index 81827e6..1c40951 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -507,6 +507,33 @@ test_expect_success 'relative path works with user@host:path' '
 	)
 '
 
+test_expect_failure 'relative path works with ../relative/repo' '
+	(
+		cd reltest &&
+		cp pristine-.git-config .git/config &&
+		git config remote.origin.url ../relative/repo &&
+		git submodule init &&
+		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' '
+	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 &&
diff --git a/t/t7403-submodule-sync.sh b/t/t7403-submodule-sync.sh
index 3620215..788bc24 100755
--- a/t/t7403-submodule-sync.sh
+++ b/t/t7403-submodule-sync.sh
@@ -86,4 +86,14 @@ test_expect_success '"git submodule sync" should not vivify uninteresting submod
 	)
 '
 
+test_expect_failure '"git submodule sync" should handle a super with a relative origin URL' '
+	git clone super relative-clone &&
+	(cd relative-clone &&
+	 git submodule update --init &&
+	 git remote set-url origin ../relative/super.git &&
+	 git submodule sync &&
+	 test "$(git config submodule.submodule.url)" == ../../relative/moved-submodule
+	)
+'
+
 test_done
-- 
1.7.10.2.649.gec87875
Next: Jon Seymour
Message 1 of 10 in “submodule: add tests for add,sync,init in presence of relative super origin URL”
  1. 1/2 submodule: add tests for add,sync,init in presence of relative super origin URLJon Seymour, May 19, 2012
  2. 2/2 submodule: fix handling of supermodules with relative origin URLsJon Seymour, May 19, 2012
  3. Jens LehmannMay 19, 2012
  4. Jon SeymourMay 19, 2012
  5. Jon SeymourMay 19, 2012
  6. Jon SeymourMay 19, 2012
  7. Jens LehmannMay 20, 2012
  8. Jon SeymourMay 20, 2012
  9. Junio C HamanoMay 20, 2012
  10. Consistently use "superproject" instead of "supermodule"Jens Lehmann, May 20, 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.