mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 22:26:52 +08:00
Avoid global and user git config leaking into git tests
This commit is contained in:
parent
fab06020af
commit
e3d8b315ed
|
@ -6,9 +6,12 @@
|
|||
# Tests run from git (e.g. git rebase --exec 'ninja test'...) inherit a weird git environment.
|
||||
# Ensure that no git environment variables are inherited.
|
||||
for varname in (set -x | string match 'GIT_*' | string replace -r ' .*' '')
|
||||
set -e $varname
|
||||
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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user