aboutsummaryrefslogtreecommitdiff
path: root/t/t7400-submodule-basic.sh
diff options
context:
space:
mode:
authorJon Seymour <jon.seymour@gmail.com>2012-06-03 19:46:48 +1000
committerJunio C Hamano <gitster@pobox.com>2012-06-03 14:35:09 -0700
commit49301c64f3612d68058efb428a74133ac6e4a071 (patch)
tree9abd38646270633e6aa081a9082c5432ad168c1d /t/t7400-submodule-basic.sh
parent712693e8dbf188d4e9337c065617f09f7a0d1a16 (diff)
downloadgit-49301c64f3612d68058efb428a74133ac6e4a071.tar.gz
git-49301c64f3612d68058efb428a74133ac6e4a071.tar.xz
submodule: document failure to handle relative superproject origin URLs
This test case documents several cases where handling of relative superproject origin URLs doesn't produce an expected result. submodule.{sub}.url in the superproject is incorrect in these cases: foo ./foo ./foo/bar The remote.origin.url of the submodule is incorrect in the above cases and also when the superproject origin URL is like: foo/bar ../foo ../foo/bar Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7400-submodule-basic.sh')
-rwxr-xr-xt/t7400-submodule-basic.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index 9428c7a74..09e2b9bf1 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -564,6 +564,18 @@ test_expect_success '../subrepo works with scp-style URL - user@host:path/to/rep
)
'
+test_expect_failure '../subrepo works with relative local path - foo' '
+ (
+ cd reltest &&
+ cp pristine-.git-config .git/config &&
+ cp pristine-.gitmodules .gitmodules &&
+ git config remote.origin.url foo &&
+ # actual: fails with an error
+ git submodule init &&
+ test "$(git config submodule.sub.url)" = subrepo
+ )
+'
+
test_expect_success '../subrepo works with relative local path - foo/bar' '
(
cd reltest &&
@@ -575,6 +587,28 @@ test_expect_success '../subrepo works with relative local path - foo/bar' '
)
'
+test_expect_failure '../subrepo works with relative local path - ./foo' '
+ (
+ cd reltest &&
+ cp pristine-.git-config .git/config &&
+ cp pristine-.gitmodules .gitmodules &&
+ git config remote.origin.url ./foo &&
+ git submodule init &&
+ test "$(git config submodule.sub.url)" = subrepo
+ )
+'
+
+test_expect_failure '../subrepo works with relative local path - ./foo/bar' '
+ (
+ cd reltest &&
+ cp pristine-.git-config .git/config &&
+ cp pristine-.gitmodules .gitmodules &&
+ git config remote.origin.url ./foo/bar &&
+ git submodule init &&
+ test "$(git config submodule.sub.url)" = foo/subrepo
+ )
+'
+
test_expect_success '../subrepo works with relative local path - ../foo' '
(
cd reltest &&