Skip to content

Commit 94b3172

Browse files
committed
tests: workaround global cfg relative to USERPROFILE
On Windows, gix-config will look for the global git config file relative to USERPROFILE. This breaks a few tests that set global config. Workaround by setting GIT_CONFIG_GLOBAL on platforms that have USERPROFILE set. gix-config gives priority to GIT_CONFIG_GLOBAL.
1 parent 56f9710 commit 94b3172

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

t/test-lib.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,13 @@ HOME="$TRASH_DIRECTORY"
11871187
GNUPGHOME="$HOME/gnupg-home-not-used"
11881188
export HOME GNUPGHOME USER_HOME
11891189

1190+
# Workaround for gix-config looking for global config in USERPROFILE.
1191+
if test -n "$USERPROFILE"
1192+
then
1193+
GIT_CONFIG_GLOBAL="$HOME/.gitconfig"
1194+
export GIT_CONFIG_GLOBAL
1195+
fi
1196+
11901197
# "rm -rf" existing trash directory, even if a previous run left it
11911198
# with bad permissions.
11921199
remove_trash_directory () {

0 commit comments

Comments
 (0)