aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLinus Heckemann <git@sphalerite.org>2022-12-02 20:24:05 +0100
committerLinus Heckemann <git@sphalerite.org>2022-12-02 20:24:34 +0100
commitff62f6a84b6a845d11ea2cd4551bfb3536249755 (patch)
treeaf8a045acf544c35ba64fbd9170ff13e8d5c3bbc /tests
parente4a2a08b0468abe972bdb80f3dd3711c70bb2440 (diff)
tests/fetchGitSubmodules: fix for newer Git
Diffstat (limited to 'tests')
-rw-r--r--tests/fetchGitSubmodules.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/fetchGitSubmodules.sh b/tests/fetchGitSubmodules.sh
index 5f104355f..50da4cb97 100644
--- a/tests/fetchGitSubmodules.sh
+++ b/tests/fetchGitSubmodules.sh
@@ -14,6 +14,15 @@ subRepo=$TEST_ROOT/gitSubmodulesSub
rm -rf ${rootRepo} ${subRepo} $TEST_HOME/.cache/nix
+# Submodules can't be fetched locally by default, which can cause
+# information leakage vulnerabilities, but for these tests our
+# submodule is intentionally local and it's all trusted, so we
+# disable this restriction. Setting it per repo is not sufficient, as
+# the repo-local config does not apply to the commands run from
+# outside the repos by Nix.
+export XDG_CONFIG_HOME=$TEST_HOME/.config
+git config --global protocol.file.allow always
+
initGitRepo() {
git init $1
git -C $1 config user.email "foobar@example.com"