-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't set global Git config when running tests
- Loading branch information
Showing
1 changed file
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 [email protected] | ||
git config --local user.name "John Doe" | ||
git config --local user.email [email protected] | ||
# 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 | ||
|