-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setting default GIT configuration as test/ being HOME during tests
- Loading branch information
Showing
2 changed files
with
12 additions
and
1 deletion.
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
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 |
---|---|---|
|
@@ -23,6 +23,17 @@ fi | |
export XDG_CONFIG_HOME=$SCRIPT_DIR | ||
export HOME=$SCRIPT_DIR | ||
export GIT_CONFIG_NOSYSTEM=1 | ||
# Set global GIT configuration for tests: | ||
if [ ! -f "${HOME}/.gitconfig" ]; then | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Your Name" | ||
git config --global init.defaultBranch "master" | ||
git config --global --add safe.directory "$(pwd)" | ||
git config --global --add safe.directory "$(pwd)/.git" | ||
if ! git symbolic-ref --short --quiet HEAD; then | ||
git checkout -b test | ||
fi | ||
fi | ||
# To be able to view current GIT confirguration during tests execution, | ||
# run the test suite by adding the '-v' option to the prove command. | ||
git config --list | ||
|