submodule: fix handling of superproject origin URLs like foo, ./foo and ./foo/bar

Currently git submodule init and git submodule sync fail with an error
if the superproject origin URL is of the form foo but succeed if the
superproject origin URL is of the form ./foo or ./foo/bar or foo/bar.

This change makes handling of the foo case behave like the handling
of the ./foo case and also ensures that superfluous leading and
embedded ./'s are removed from the resulting derived URLs.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jon Seymour
2012-06-06 21:57:30 +10:00
committed by Junio C Hamano
parent 967b2c6673
commit 758615e251
3 changed files with 18 additions and 8 deletions

View File

@ -564,7 +564,7 @@ test_expect_success '../subrepo works with scp-style URL - user@host:path/to/rep
)
'
test_expect_failure '../subrepo works with relative local path - foo' '
test_expect_success '../subrepo works with relative local path - foo' '
(
cd reltest &&
cp pristine-.git-config .git/config &&
@ -587,7 +587,7 @@ test_expect_success '../subrepo works with relative local path - foo/bar' '
)
'
test_expect_failure '../subrepo works with relative local path - ./foo' '
test_expect_success '../subrepo works with relative local path - ./foo' '
(
cd reltest &&
cp pristine-.git-config .git/config &&
@ -598,7 +598,7 @@ test_expect_failure '../subrepo works with relative local path - ./foo' '
)
'
test_expect_failure '../subrepo works with relative local path - ./foo/bar' '
test_expect_success '../subrepo works with relative local path - ./foo/bar' '
(
cd reltest &&
cp pristine-.git-config .git/config &&