diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-05-07 06:47:39 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-05-07 06:47:39 +0300 |
commit | e706aaf3bc8ad97877cbf21887f96c5af66c7562 (patch) | |
tree | 2d59cb87fcea92978ae4b9ed202a6993a627f5e5 /builtin | |
parent | f16a4660de5751ca8c5229698d97b02e6676298c (diff) | |
parent | 482d5499067b2a1fc8d1ebfb5160022dc23ab136 (diff) |
Merge branch 'ps/config-global-override'
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
config: allow overriding of global and system configuration
config: unify code paths to get global config paths
config: rename `git_etc_config()`
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/config.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/config.c b/builtin/config.c index f71fa39b38..865fddd6ce 100644 --- a/builtin/config.c +++ b/builtin/config.c @@ -671,9 +671,9 @@ int cmd_config(int argc, const char **argv, const char *prefix) } if (use_global_config) { - char *user_config = expand_user_path("~/.gitconfig", 0); - char *xdg_config = xdg_config_home("config"); + char *user_config, *xdg_config; + git_global_config(&user_config, &xdg_config); if (!user_config) /* * It is unknown if HOME/.gitconfig exists, so @@ -695,7 +695,7 @@ int cmd_config(int argc, const char **argv, const char *prefix) } } else if (use_system_config) { - given_config_source.file = git_etc_gitconfig(); + given_config_source.file = git_system_config(); given_config_source.scope = CONFIG_SCOPE_SYSTEM; } else if (use_local_config) { given_config_source.file = git_pathdup("config"); |