Skip to content

Commit 0d3beb7

Browse files
committed
t/t7NNN: 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. Test scripts that rely on submodules throughout use a `git config --global` during a setup test towards the beginning of the script. Signed-off-by: Taylor Blau <[email protected]>
1 parent 0f21b8f commit 0d3beb7

23 files changed

+62
-1
lines changed

t/t7001-mv.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ test_expect_success SYMLINKS 'check moved symlink' '
307307
rm -f moved symlink
308308

309309
test_expect_success 'setup submodule' '
310+
test_config_global protocol.file.allow always &&
310311
git commit -m initial &&
311312
git reset --hard &&
312313
git submodule add ./. sub &&
@@ -513,6 +514,7 @@ test_expect_success 'moving a submodule in nested directories' '
513514
'
514515

515516
test_expect_success 'moving nested submodules' '
517+
test_config_global protocol.file.allow always &&
516518
git commit -am "cleanup commit" &&
517519
mkdir sub_nested_nested &&
518520
(cd sub_nested_nested &&

t/t7064-wtstatus-pv2.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ test_expect_success 'create and add submodule, submodule appears clean (A. S...)
462462
git checkout initial-branch &&
463463
git clone . sub_repo &&
464464
git clone . super_repo &&
465+
test_config_global protocol.file.allow always &&
465466
( cd super_repo &&
466467
git submodule add ../sub_repo sub1 &&
467468

t/t7300-clean.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ test_expect_success 'should not clean submodules' '
480480
git init &&
481481
test_commit msg hello.world
482482
) &&
483+
test_config_global protocol.file.allow always &&
483484
git submodule add ./repo/.git sub1 &&
484485
git commit -m "sub1" &&
485486
git branch before_sub2 &&

t/t7400-submodule-basic.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ subcommands of git submodule.
1111

1212
. ./test-lib.sh
1313

14+
test_expect_success 'setup - enable local submodules' '
15+
git config --global protocol.file.allow always
16+
'
17+
1418
test_expect_success 'submodule deinit works on empty repository' '
1519
git submodule deinit --all
1620
'

t/t7403-submodule-sync.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ These tests exercise the "git submodule sync" subcommand.
1111
. ./test-lib.sh
1212

1313
test_expect_success setup '
14+
git config --global protocol.file.allow always &&
15+
1416
echo file >file &&
1517
git add file &&
1618
test_tick &&

t/t7406-submodule-update.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ compare_head()
2222

2323

2424
test_expect_success 'setup a submodule tree' '
25+
git config --global protocol.file.allow always &&
2526
echo file > file &&
2627
git add file &&
2728
test_tick &&

t/t7407-submodule-foreach.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ that are currently checked out.
1313

1414

1515
test_expect_success 'setup a submodule tree' '
16+
git config --global protocol.file.allow always &&
1617
echo file > file &&
1718
git add file &&
1819
test_tick &&

t/t7408-submodule-reference.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ test_alternate_is_used () {
1717
test_cmp expect actual
1818
}
1919

20+
test_expect_success 'setup' '
21+
git config --global protocol.file.allow always
22+
'
23+
2024
test_expect_success 'preparing first repository' '
2125
test_create_repo A &&
2226
(

t/t7409-submodule-detached-work-tree.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ on detached working trees
1212
TEST_NO_CREATE_REPO=1
1313
. ./test-lib.sh
1414

15+
test_expect_success 'setup' '
16+
git config --global protocol.file.allow always
17+
'
18+
1519
test_expect_success 'submodule on detached working tree' '
1620
git init --bare remote &&
1721
test_create_repo bundle1 &&

t/t7411-submodule-config.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ from the database and from the worktree works.
1212
TEST_NO_CREATE_REPO=1
1313
. ./test-lib.sh
1414

15+
test_expect_success 'setup' '
16+
git config --global protocol.file.allow always
17+
'
1518
test_expect_success 'submodule config cache setup' '
1619
mkdir submodule &&
1720
(cd submodule &&

0 commit comments

Comments
 (0)