From: W. Trevor King Date: Mon, 3 Dec 2012 13:02:42 +0000 (-0500) Subject: t7400: need explicit sync to set super's submodule.name.url X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=28a58d79d329b880a19517e4c34ac83bd48b4f46;p=git.git t7400: need explicit sync to set super's submodule.name.url Don't rely on this being a side effect of `submodule init`. Signed-off-by: W. Trevor King --- diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh index 8ce45ce2c..1a9ac0783 100755 --- a/t/t7400-submodule-basic.sh +++ b/t/t7400-submodule-basic.sh @@ -509,6 +509,7 @@ test_expect_success '../subrepo works with URL - ssh://hostname/repo' ' cp pristine-.gitmodules .gitmodules && git config remote.origin.url ssh://hostname/repo && git submodule init && + git submodule sync && test "$(git config submodule.sub.url)" = ssh://hostname/subrepo ) ' @@ -520,6 +521,7 @@ test_expect_success '../subrepo works with port-qualified URL - ssh://hostname:2 cp pristine-.gitmodules .gitmodules && git config remote.origin.url ssh://hostname:22/repo && git submodule init && + git submodule sync && test "$(git config submodule.sub.url)" = ssh://hostname:22/subrepo ) ' @@ -536,6 +538,7 @@ test_expect_success '../subrepo path works with local path - //somewhere else/re cp pristine-.gitmodules .gitmodules && git config remote.origin.url "//somewhere else/repo" && git submodule init && + git submodule sync && test "$(git config submodule.sub.url)" = "//somewhere else/subrepo" ) ' @@ -547,6 +550,7 @@ test_expect_success '../subrepo works with file URL - file:///tmp/repo' ' cp pristine-.gitmodules .gitmodules && git config remote.origin.url file:///tmp/repo && git submodule init && + git submodule sync && test "$(git config submodule.sub.url)" = file:///tmp/subrepo ) ' @@ -558,6 +562,7 @@ test_expect_success '../subrepo works with helper URL- helper:://hostname/repo' cp pristine-.gitmodules .gitmodules && git config remote.origin.url helper:://hostname/repo && git submodule init && + git submodule sync && test "$(git config submodule.sub.url)" = helper:://hostname/subrepo ) ' @@ -568,6 +573,7 @@ test_expect_success '../subrepo works with scp-style URL - user@host:repo' ' cp pristine-.git-config .git/config && git config remote.origin.url user@host:repo && git submodule init && + git submodule sync && test "$(git config submodule.sub.url)" = user@host:subrepo ) ' @@ -579,6 +585,7 @@ test_expect_success '../subrepo works with scp-style URL - user@host:path/to/rep cp pristine-.gitmodules .gitmodules && git config remote.origin.url user@host:path/to/repo && git submodule init && + git submodule sync && test "$(git config submodule.sub.url)" = user@host:path/to/subrepo ) ' @@ -591,6 +598,7 @@ test_expect_success '../subrepo works with relative local path - foo' ' git config remote.origin.url foo && # actual: fails with an error git submodule init && + git submodule sync && test "$(git config submodule.sub.url)" = subrepo ) ' @@ -602,6 +610,7 @@ test_expect_success '../subrepo works with relative local path - foo/bar' ' cp pristine-.gitmodules .gitmodules && git config remote.origin.url foo/bar && git submodule init && + git submodule sync && test "$(git config submodule.sub.url)" = foo/subrepo ) ' @@ -613,6 +622,7 @@ test_expect_success '../subrepo works with relative local path - ./foo' ' cp pristine-.gitmodules .gitmodules && git config remote.origin.url ./foo && git submodule init && + git submodule sync && test "$(git config submodule.sub.url)" = subrepo ) ' @@ -624,6 +634,7 @@ test_expect_success '../subrepo works with relative local path - ./foo/bar' ' cp pristine-.gitmodules .gitmodules && git config remote.origin.url ./foo/bar && git submodule init && + git submodule sync && test "$(git config submodule.sub.url)" = foo/subrepo ) ' @@ -635,6 +646,7 @@ test_expect_success '../subrepo works with relative local path - ../foo' ' cp pristine-.gitmodules .gitmodules && git config remote.origin.url ../foo && git submodule init && + git submodule sync && test "$(git config submodule.sub.url)" = ../subrepo ) ' @@ -646,6 +658,7 @@ test_expect_success '../subrepo works with relative local path - ../foo/bar' ' cp pristine-.gitmodules .gitmodules && git config remote.origin.url ../foo/bar && git submodule init && + git submodule sync && test "$(git config submodule.sub.url)" = ../foo/subrepo ) ' @@ -660,6 +673,7 @@ test_expect_success '../bar/a/b/c works with relative local path - ../foo/bar.gi git config remote.origin.url ../foo/bar.git && git submodule add ../bar/a/b/c ./a/b/c && git submodule init && + git submodule sync && test "$(git config submodule.a/b/c.url)" = ../foo/bar/a/b/c ) '