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

[PATCH 1/3] Fix relative submodule setup of submodule tests

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
Nov 13, 2012, 08:34 UTC
Message-ID
<20121113083428.GB38188@book.hvoigt.net>
In-Reply-To
<20121113083233.GA38188@book.hvoigt.net>

If a remote is configured in a superproject relative submodule urls should be relative to that remote. Since we have a bug in relative path calculation for superproject paths that contain a "/." using ../submodule was accepted here. We are going to fix this behavior so we first need to correct these tests.

Later tests expect the submodules origin to be in a directory underneath the tests root. Lets remove the origin from super (which points directly at the tests root directory) to keep these tests expectations.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
---
 t/t7403-submodule-sync.sh    | 2 ++
 t/t7406-submodule-update.sh  | 2 ++
 t/t7407-submodule-foreach.sh | 2 ++
 t/t7506-status-submodule.sh  | 2 ++
 4 files changed, 8 insertions(+)
diff --git a/t/t7403-submodule-sync.sh b/t/t7403-submodule-sync.sh
index 524d5c1..b310a58 100755
--- a/t/t7403-submodule-sync.sh
+++ b/t/t7403-submodule-sync.sh
@@ -18,6 +18,8 @@ test_expect_success setup '
 	git clone . super &&
 	git clone super submodule &&
 	(cd super &&
+	 # relative submodule urls relate to this folder not the remotes
+	 git remote rm origin &&
 	 git submodule add ../submodule submodule &&
 	 test_tick &&
 	 git commit -m "submodule"
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index 1542653..f3628c9 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -32,6 +32,8 @@ test_expect_success 'setup a submodule tree' '
 	git clone super merging &&
 	git clone super none &&
 	(cd super &&
+	 # relative submodule urls relate to this folder not the remotes
+	 git remote rm origin &&
 	 git submodule add ../submodule submodule &&
 	 test_tick &&
 	 git commit -m "submodule" &&
diff --git a/t/t7407-submodule-foreach.sh b/t/t7407-submodule-foreach.sh
index 9b69fe2..99956a6 100755
--- a/t/t7407-submodule-foreach.sh
+++ b/t/t7407-submodule-foreach.sh
@@ -21,6 +21,8 @@ test_expect_success 'setup a submodule tree' '
 	git clone super submodule &&
 	(
 		cd super &&
+		# relative submodule urls relate to this folder not the remotes
+		git remote rm origin &&
 		git submodule add ../submodule sub1 &&
 		git submodule add ../submodule sub2 &&
 		git submodule add ../submodule sub3 &&
diff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh
index d31b34d..9021b1a 100755
--- a/t/t7506-status-submodule.sh
+++ b/t/t7506-status-submodule.sh
@@ -203,6 +203,8 @@ test_expect_success 'status with merge conflict in .gitmodules' '
 	test_create_repo_with_commit sub2 &&
 	(
 		cd super &&
+		# relative submodule urls relate to this folder not the remotes
+		git remote rm origin &&
 		prev=$(git rev-parse HEAD) &&
 		git checkout -b add_sub1 &&
 		git submodule add ../sub1 &&
-- 
1.8.0.3.gaed4666
Previous: Heiko VoigtNext: Heiko Voigt
Message 5 of 7 in “git commit/push can fail silently when clone omits ".git"”
  1. Jeffrey S. HaemerNov 4, 2012
  2. Jeff KingNov 8, 2012
  3. Heiko VoigtNov 9, 2012
  4. 0/3 fix cloning superprojects from "."Heiko Voigt, Nov 13, 2012
  5. 1/3 Fix relative submodule setup of submodule testsHeiko Voigt, Nov 13, 2012
  6. 2/3 ensure that relative submodule url needs ./ or ../Heiko Voigt, Nov 13, 2012
  7. 3/3 fix corner case for relative submodule path calculationHeiko Voigt, Nov 13, 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.