]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/t1NNN: allow local submodules
authorTaylor Blau <me@ttaylorr.com>
Fri, 29 Jul 2022 19:16:10 +0000 (15:16 -0400)
committerTaylor Blau <me@ttaylorr.com>
Sat, 1 Oct 2022 04:23:38 +0000 (00:23 -0400)
To prepare for the default value of `protocol.file.allow` to change to
"user", ensure tests that rely on local submodules can initialize them
over the file protocol.

Tests that only need to interact with submodules in a limited capacity
have individual Git commands annotated with the appropriate
configuration via `-c`. Tests that interact with submodules a handful of
times use `test_config_global` instead.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
t/t1091-sparse-checkout-builtin.sh
t/t1500-rev-parse.sh

index 84acfc48b6786a43d82f5185465c42f4417b9a02..749c8f1c0ab82a2f872b9d4b628aa748448f0e1c 100755 (executable)
@@ -449,7 +449,8 @@ test_expect_success 'interaction with submodules' '
        (
                cd super &&
                mkdir modules &&
-               git submodule add ../repo modules/child &&
+               git -c protocol.file.allow=always \
+                       submodule add ../repo modules/child &&
                git add . &&
                git commit -m "add submodule" &&
                git sparse-checkout init --cone &&
index 408b97d5af9551f91a86e70c6c37b912719bfd15..acef9fda0c62d1935ee9b24a5c935a6d82025102 100755 (executable)
@@ -163,7 +163,8 @@ test_expect_success 'showing the superproject correctly' '
        test_commit -C super test_commit &&
        test_create_repo sub &&
        test_commit -C sub test_commit &&
-       git -C super submodule add ../sub dir/sub &&
+       git -c protocol.file.allow=always \
+               -C super submodule add ../sub dir/sub &&
        echo $(pwd)/super >expect  &&
        git -C super/dir/sub rev-parse --show-superproject-working-tree >out &&
        test_cmp expect out &&