Skip to content

Commit 8594a15

Browse files
committed
Setting default GIT configuration as test/ being HOME during tests
1 parent e4f529e commit 8594a15

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/setup

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ fi
2323
export XDG_CONFIG_HOME=$SCRIPT_DIR
2424
export HOME=$SCRIPT_DIR
2525
export GIT_CONFIG_NOSYSTEM=1
26+
# Set global GIT configuration for tests:
27+
if [ ! -f "${HOME}/.gitconfig" ]; then
28+
git config --global user.email "you@example.com"
29+
git config --global user.name "Your Name"
30+
git config --global init.defaultBranch "master"
31+
git config --global --add safe.directory "$(pwd)"
32+
fi
2633
# To be able to view current GIT confirguration during tests execution,
2734
# run the test suite by adding the '-v' option to the prove command.
2835
git config --list

0 commit comments

Comments
 (0)