t7400: Test submodule's configured remote URL
authorW. Trevor King <wking@tremily.us>
Sun, 2 Dec 2012 15:25:01 +0000 (10:25 -0500)
committerW. Trevor King <wking@tremily.us>
Sun, 2 Dec 2012 18:22:27 +0000 (13:22 -0500)
Note that relative repository arguments passed to

  $ git submodule add <repository> [<path>]

are expanded relative to the superproject's remote URL, not relative
to the current working directory, which is why /foo/ shows up in the
configured URLs.

Signed-off-by: W. Trevor King <wking@tremily.us>
t/t7400-submodule-basic.sh

index ee119adf5b818cea20d40552929a4e4f0f0efe14..0b9a2612e1d16c1038aae48e43072df0e5f14744 100755 (executable)
@@ -661,7 +661,8 @@ 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 &&
-               test "$(git config submodule.a/b/c.url)" = ../foo/bar/a/b/c
+               test "$(git config submodule.a/b/c.url)" = ../foo/bar/a/b/c &&
+               test "$(cd a/b/c && git config remote.origin.url)" = ../../../../foo/bar/a/b/c
        )
 '