mirror of
https://github.com/git/git.git
synced 2024-05-06 15:46:41 +02:00
Merge branch 'ps/config-global-override' into next
Replace GIT_CONFIG_NOSYSTEM mechanism to decline from reading the system-wide configuration file with GIT_CONFIG_SYSTEM that lets users specify from which file to read the system-wide configuration (setting it to an empty file would essentially be the same as setting NOSYSTEM), and introduce GIT_CONFIG_GLOBAL to override the per-user configuration in $HOME/.gitconfig. * ps/config-global-override: t1300: fix unset of GIT_CONFIG_NOSYSTEM leaking into subsequent tests
This commit is contained in:
commit
5ce435d98f
|
@ -2092,21 +2092,20 @@ test_expect_success 'override global and system config' '
|
|||
git config --show-scope --list >output &&
|
||||
test_cmp expect output &&
|
||||
|
||||
sane_unset GIT_CONFIG_NOSYSTEM &&
|
||||
|
||||
cat >expect <<-EOF &&
|
||||
system system.config=true
|
||||
global global.config=true
|
||||
local local.config=true
|
||||
EOF
|
||||
GIT_CONFIG_SYSTEM=custom-system-config GIT_CONFIG_GLOBAL=custom-global-config \
|
||||
GIT_CONFIG_NOSYSTEM=false GIT_CONFIG_SYSTEM=custom-system-config GIT_CONFIG_GLOBAL=custom-global-config \
|
||||
git config --show-scope --list >output &&
|
||||
test_cmp expect output &&
|
||||
|
||||
cat >expect <<-EOF &&
|
||||
local local.config=true
|
||||
EOF
|
||||
GIT_CONFIG_SYSTEM=/dev/null GIT_CONFIG_GLOBAL=/dev/null git config --show-scope --list >output &&
|
||||
GIT_CONFIG_NOSYSTEM=false GIT_CONFIG_SYSTEM=/dev/null GIT_CONFIG_GLOBAL=/dev/null \
|
||||
git config --show-scope --list >output &&
|
||||
test_cmp expect output
|
||||
'
|
||||
|
||||
|
|
Loading…
Reference in New Issue