submodule: fix sync handling of some relative superproject origin URLs
commit967b2c66738fe6b168ead0c3106ac47fb9ae22c7
authorJon Seymour <jon.seymour@gmail.com>
Wed, 6 Jun 2012 11:57:29 +0000 (6 21:57 +1000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Jun 2012 18:40:59 +0000 (6 11:40 -0700)
tree4b67e412a47cd16e0678d260065892239abbc03d
parent49301c64f3612d68058efb428a74133ac6e4a071
submodule: fix sync handling of some relative superproject origin URLs

When the origin URL of the superproject is itself relative, git submodule sync
configures the remote.origin.url configuration property of the submodule
with a path that is relative to the work tree of the superproject
rather than the work tree of the submodule.

To fix this an 'up_path' that navigates from the work tree of the submodule
to the work tree of the superproject needs to be prepended to the URL
otherwise calculated.

Correct handling of superproject origin URLs like foo, ./foo and ./foo/bar is
left to a subsequent patch since an additional change is required to handle
these cases.

The documentation of resolve_relative_url() is expanded to give a more thorough
description of the function's objective.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-submodule.sh
t/t7403-submodule-sync.sh