From f88979c67ec8ea504f30db02b9fe47941a70c7bd Mon Sep 17 00:00:00 2001 From: James Murty Date: Tue, 10 Sep 2024 00:42:43 +1000 Subject: [PATCH] Don't set global Git config when running tests --- tests/_test_helper.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/_test_helper.bash b/tests/_test_helper.bash index ebf2ba3..714c7c5 100644 --- a/tests/_test_helper.bash +++ b/tests/_test_helper.bash @@ -7,13 +7,13 @@ function init_git_repo { echo "WARNING: Test repo already exists at $BATS_TEST_DIRNAME/.git" else # Configure "main" as the default branch name - git config --global init.defaultBranch main + git config --local init.defaultBranch main # Initialise test git repo at the same path as the test files git init "$BATS_TEST_DIRNAME" git checkout -b main # Tests will fail if name and email aren't set - git config user.name "John Doe" - git config user.email johndoe@example.com + git config --local user.name "John Doe" + git config --local user.email johndoe@example.com # Flag test git repo as 100% the test one, for safety before later removal touch "$BATS_TEST_DIRNAME"/.git/repo-for-transcrypt-bats-tests fi