aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-01-19 08:26:41 -0800
committerJunio C Hamano <gitster@pobox.com>2011-01-19 08:26:41 -0800
commit8a59702ad888c8c399b096759c1c678ffeca5b03 (patch)
tree5674eda08174e7e2cc0c0e6dfe0b74d8db2e8fbf /t
parentea9590789fecdf1eb48bba6d8b8cadab3441fbda (diff)
parentea640cc691d56f7151c5ba654b09c4a987dbef93 (diff)
downloadgit-8a59702ad888c8c399b096759c1c678ffeca5b03.tar.gz
git-8a59702ad888c8c399b096759c1c678ffeca5b03.tar.xz
Merge branch 'tr/submodule-relative-scp-url' into maint
* tr/submodule-relative-scp-url: submodule: fix relative url parsing for scp-style origin
Diffstat (limited to 't')
-rwxr-xr-xt/t7400-submodule-basic.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index 2c49db9f6..874279e32 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -446,4 +446,42 @@ test_expect_success 'add should fail when path is used by an existing directory'
)
'
+test_expect_success 'set up for relative path tests' '
+ mkdir reltest &&
+ (
+ cd reltest &&
+ git init &&
+ mkdir sub &&
+ (
+ cd sub &&
+ git init &&
+ test_commit foo
+ ) &&
+ git add sub &&
+ git config -f .gitmodules submodule.sub.path sub &&
+ git config -f .gitmodules submodule.sub.url ../subrepo &&
+ cp .git/config pristine-.git-config
+ )
+'
+
+test_expect_success 'relative path works with URL' '
+ (
+ cd reltest &&
+ cp pristine-.git-config .git/config &&
+ git config remote.origin.url ssh://hostname/repo &&
+ git submodule init &&
+ test "$(git config submodule.sub.url)" = ssh://hostname/subrepo
+ )
+'
+
+test_expect_success 'relative path works with user@host:path' '
+ (
+ cd reltest &&
+ cp pristine-.git-config .git/config &&
+ git config remote.origin.url user@host:repo &&
+ git submodule init &&
+ test "$(git config submodule.sub.url)" = user@host:subrepo
+ )
+'
+
test_done