Skip to content

Commit 8a96dbc

Browse files
committed
t/t1NNN: allow local submodules
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 <[email protected]>
1 parent 7de0c30 commit 8a96dbc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

t/t1091-sparse-checkout-builtin.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,8 @@ test_expect_success 'interaction with submodules' '
449449
(
450450
cd super &&
451451
mkdir modules &&
452-
git submodule add ../repo modules/child &&
452+
git -c protocol.file.allow=always \
453+
submodule add ../repo modules/child &&
453454
git add . &&
454455
git commit -m "add submodule" &&
455456
git sparse-checkout init --cone &&

t/t1500-rev-parse.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ test_expect_success 'showing the superproject correctly' '
163163
test_commit -C super test_commit &&
164164
test_create_repo sub &&
165165
test_commit -C sub test_commit &&
166-
git -C super submodule add ../sub dir/sub &&
166+
git -c protocol.file.allow=always \
167+
-C super submodule add ../sub dir/sub &&
167168
echo $(pwd)/super >expect &&
168169
git -C super/dir/sub rev-parse --show-superproject-working-tree >out &&
169170
test_cmp expect out &&

0 commit comments

Comments
 (0)