Bug Description
I'm testing some git capabilities writing tests, and I'd like to avoid writing to the user system. For that, git is aware of GIT_CONFIG_SYSTEM and GIT_CONFIG_GLOBAL to avoid messing up with that.
These env vars are not used by the library, which could be handy for testing purposes.
go-git Version
5.11.0
Steps to Reproduce
This shell script works verifies it:
tmpdir="$(mktemp -d)"
export GIT_CONFIG_SYSTEM="$tmpdir/system.gitconfig"
export GIT_CONFIG_GLOBAL=/dev/null
export XDG_CONFIG_HOME="$tmpdir/xdg"
export HOME="$tmpdir/home"
mkdir -p "$tmpdir/xdg" "$tmpdir/home"
# Write “system” config safely without sudo:
git config --system user.name "Test System User"
git config --system user.email "[email protected]"
# Verify precedence works as expected:
git config --list --show-origin
# ...run your test commands here...
rm -rf "$tmpdir"
Additional Information
No response
Bug Description
I'm testing some git capabilities writing tests, and I'd like to avoid writing to the user system. For that, git is aware of GIT_CONFIG_SYSTEM and GIT_CONFIG_GLOBAL to avoid messing up with that.
These env vars are not used by the library, which could be handy for testing purposes.
go-git Version
5.11.0
Steps to Reproduce
This shell script works verifies it:
Additional Information
No response