Avoid global and user git config leaking into git tests

This commit is contained in:
Johannes Altmanninger 2021-07-12 21:37:17 +02:00
parent fab06020af
commit e3d8b315ed

View File

@ -9,6 +9,9 @@ for varname in (set -x | string match 'GIT_*' | string replace -r ' .*' '')
set -e $varname
end
set -gx GIT_CONFIG_GLOBAL /dev/null # No ~/.gitconfig. We could also override $HOME.
set -gx GIT_CONFIG_NOSYSTEM true # No /etc/gitconfig
# Also ensure that git-core is not in $PATH, as this adds weird git commands like `git-add--interactive`.
set PATH (string match --invert '*git-core*' -- $PATH)