diff options
author | Jon Seymour <jon.seymour@gmail.com> | 2012-06-03 19:46:48 +1000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-06-03 14:35:09 -0700 |
commit | 49301c64f3612d68058efb428a74133ac6e4a071 (patch) | |
tree | 9abd38646270633e6aa081a9082c5432ad168c1d /t/t7400-submodule-basic.sh | |
parent | 712693e8dbf188d4e9337c065617f09f7a0d1a16 (diff) | |
download | git-49301c64f3612d68058efb428a74133ac6e4a071.tar.gz |
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-x | t/t7400-submodule-basic.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh index 9428c7a744..09e2b9bf16 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 && |