Skip to content

Commit ac7e57f

Browse files
committed
t/t4NNN: 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 f8d510e commit ac7e57f

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

t/t4059-diff-submodule-not-initialized.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ test_expect_success 'setup - submodules' '
4949
'
5050

5151
test_expect_success 'setup - git submodule add' '
52-
git submodule add ./sm2 sm1 &&
52+
git -c protocol.file.allow=always submodule add ./sm2 sm1 &&
5353
commit_file sm1 .gitmodules &&
5454
git diff-tree -p --no-commit-id --submodule=log HEAD -- sm1 >actual &&
5555
cat >expected <<-EOF &&

t/t4060-diff-submodule-option-diff-format.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,9 +759,9 @@ test_expect_success 'diff --submodule=diff with .git file' '
759759
'
760760

761761
test_expect_success 'setup nested submodule' '
762-
git submodule add -f ./sm2 &&
762+
git -c protocol.file.allow=always submodule add -f ./sm2 &&
763763
git commit -a -m "add sm2" &&
764-
git -C sm2 submodule add ../sm2 nested &&
764+
git -c protocol.file.allow=always -C sm2 submodule add ../sm2 nested &&
765765
git -C sm2 commit -a -m "nested sub" &&
766766
head10=$(git -C sm2 rev-parse --short --verify HEAD)
767767
'

t/t4067-diff-partial-clone.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ test_expect_success 'diff skips same-OID blobs' '
7777

7878
test_expect_success 'when fetching missing objects, diff skips GITLINKs' '
7979
test_when_finished "rm -rf sub server client trace" &&
80+
test_config_global protocol.file.allow always &&
8081
8182
test_create_repo sub &&
8283
test_commit -C sub first &&

t/t4208-log-magic-pathspec.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ test_expect_success 'command line pathspec parsing for "git log"' '
126126

127127
test_expect_success 'tree_entry_interesting does not match past submodule boundaries' '
128128
test_when_finished "rm -rf repo submodule" &&
129+
test_config_global protocol.file.allow always &&
129130
git init submodule &&
130131
test_commit -C submodule initial &&
131132
git init repo &&

0 commit comments

Comments
 (0)