summaryrefslogtreecommitdiff
path: root/t/t7403-submodule-sync.sh
diff options
context:
space:
mode:
authorJon Seymour <jon.seymour@gmail.com>2012-06-06 11:57:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-06-06 18:40:59 (GMT)
commit967b2c66738fe6b168ead0c3106ac47fb9ae22c7 (patch)
tree4b67e412a47cd16e0678d260065892239abbc03d /t/t7403-submodule-sync.sh
parent49301c64f3612d68058efb428a74133ac6e4a071 (diff)
downloadgit-967b2c66738fe6b168ead0c3106ac47fb9ae22c7.zip
git-967b2c66738fe6b168ead0c3106ac47fb9ae22c7.tar.gz
git-967b2c66738fe6b168ead0c3106ac47fb9ae22c7.tar.bz2
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>
Diffstat (limited to 't/t7403-submodule-sync.sh')
-rwxr-xr-xt/t7403-submodule-sync.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/t/t7403-submodule-sync.sh b/t/t7403-submodule-sync.sh
index 56b933d..98bc74a 100755
--- a/t/t7403-submodule-sync.sh
+++ b/t/t7403-submodule-sync.sh
@@ -99,7 +99,7 @@ test_expect_failure '"git submodule sync" handles origin URL of the form foo' '
)
'
-test_expect_failure '"git submodule sync" handles origin URL of the form foo/bar' '
+test_expect_success '"git submodule sync" handles origin URL of the form foo/bar' '
(cd relative-clone &&
git remote set-url origin foo/bar &&
git submodule sync &&
@@ -132,7 +132,7 @@ test_expect_failure '"git submodule sync" handles origin URL of the form ./foo/b
)
'
-test_expect_failure '"git submodule sync" handles origin URL of the form ../foo' '
+test_expect_success '"git submodule sync" handles origin URL of the form ../foo' '
(cd relative-clone &&
git remote set-url origin ../foo &&
git submodule sync &&
@@ -143,7 +143,7 @@ test_expect_failure '"git submodule sync" handles origin URL of the form ../foo'
)
'
-test_expect_failure '"git submodule sync" handles origin URL of the form ../foo/bar' '
+test_expect_success '"git submodule sync" handles origin URL of the form ../foo/bar' '
(cd relative-clone &&
git remote set-url origin ../foo/bar &&
git submodule sync &&
@@ -154,7 +154,7 @@ test_expect_failure '"git submodule sync" handles origin URL of the form ../foo/
)
'
-test_expect_failure '"git submodule sync" handles origin URL of the form ../foo/bar with deeply nested submodule' '
+test_expect_success '"git submodule sync" handles origin URL of the form ../foo/bar with deeply nested submodule' '
(cd relative-clone &&
git remote set-url origin ../foo/bar &&
mkdir -p a/b/c &&