Skip to content

Commit f88979c

Browse files
committed
Don't set global Git config when running tests
1 parent 5b598d8 commit f88979c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/_test_helper.bash

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ function init_git_repo {
77
echo "WARNING: Test repo already exists at $BATS_TEST_DIRNAME/.git"
88
else
99
# Configure "main" as the default branch name
10-
git config --global init.defaultBranch main
10+
git config --local init.defaultBranch main
1111
# Initialise test git repo at the same path as the test files
1212
git init "$BATS_TEST_DIRNAME"
1313
git checkout -b main
1414
# Tests will fail if name and email aren't set
15-
git config user.name "John Doe"
16-
git config user.email [email protected]
15+
git config --local user.name "John Doe"
16+
git config --local user.email [email protected]
1717
# Flag test git repo as 100% the test one, for safety before later removal
1818
touch "$BATS_TEST_DIRNAME"/.git/repo-for-transcrypt-bats-tests
1919
fi

0 commit comments

Comments
 (0)