All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] submodule: add tests for add,sync,init in presence of relative super origin URL
@ 2012-05-19  4:40 Jon Seymour
  2012-05-19  4:40 ` [PATCH 2/2] submodule: fix handling of supermodules with relative origin URLs Jon Seymour
  0 siblings, 1 reply; 10+ messages in thread
From: Jon Seymour @ 2012-05-19  4:40 UTC (permalink / raw)
  To: git; +Cc: Jens.Lehmann, gitster, Jon Seymour

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

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

end of thread, other threads:[~2012-05-20 13:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-19  4:40 [PATCH 1/2] submodule: add tests for add,sync,init in presence of relative super origin URL Jon Seymour
2012-05-19  4:40 ` [PATCH 2/2] submodule: fix handling of supermodules with relative origin URLs Jon Seymour
2012-05-19 18:56   ` Jens Lehmann
2012-05-19 22:51     ` Jon Seymour
2012-05-19 23:10       ` Jon Seymour
2012-05-19 23:45         ` Jon Seymour
2012-05-20  0:34       ` Jens Lehmann
2012-05-20  1:25         ` Jon Seymour
2012-05-20  5:16       ` Junio C Hamano
2012-05-20 13:28         ` [PATCH] Consistently use "superproject" instead of "supermodule" Jens Lehmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.