Skip to content

Commit 08c2ae4

Browse files
committed
Disabling system/global git configs
1 parent d0a520d commit 08c2ae4

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/setup

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,18 @@ if [ ! -d "${SCRIPT_DIR}/../.git" ]; then
1515
git config user.name "YouUser"
1616
git add .
1717
git commit -a -m"Initial commit"
18-
git config --list
1918
fi
2019

20+
# Disable any GIT configuration set outside this 'git-subrepo' project.
21+
# This prevents specific build environment GIT settings to influence
22+
# execution of the test suite.
23+
export XDG_CONFIG_HOME=$SCRIPT_DIR
24+
export HOME=$SCRIPT_DIR
25+
export GIT_CONFIG_NOSYSTEM=1
26+
# To be able to view current GIT confirguration during tests execution,
27+
# run the test suite by adding the '-v' option to the prove command.
28+
git config --list
29+
2130
# Generate additional testing git repos, if not already present.
2231
mkdir -p "${SCRIPT_DIR}/repo"
2332
if [ ! -d "${SCRIPT_DIR}/repo/bar" ]; then

0 commit comments

Comments
 (0)