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>
This commit is contained in:
committed by
Junio C Hamano
parent
712693e8db
commit
49301c64f3
@ -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 &&
|
||||
|
||||
Reference in New Issue
Block a user