summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorPaul Tan <pyokagan@gmail.com>2015-05-06 08:01:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-05-06 18:33:48 (GMT)
commit509adc335274d2656829b18e1e83ccabda059ae3 (patch)
treef47097944c6c14024afc8408a9e5e088be0296c2 /config.c
parente682c9db1a7c6a81bb4c2e8e8c1d5191dae3bd9f (diff)
downloadgit-509adc335274d2656829b18e1e83ccabda059ae3.zip
git-509adc335274d2656829b18e1e83ccabda059ae3.tar.gz
git-509adc335274d2656829b18e1e83ccabda059ae3.tar.bz2
git-config: replace use of home_config_paths()
Since home_config_paths() combines distinct functionality already implemented by expand_user_path() and xdg_config_home(), and hides the home config file path ~/.gitconfig. Make the code more explicit by replacing the use of home_config_paths() with expand_user_path() and xdg_config_home(). Signed-off-by: Paul Tan <pyokagan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.c')
-rw-r--r--config.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/config.c b/config.c
index 752e2e2..0d7af9e 100644
--- a/config.c
+++ b/config.c
@@ -1180,10 +1180,8 @@ int git_config_system(void)
int git_config_early(config_fn_t fn, void *data, const char *repo_config)
{
int ret = 0, found = 0;
- char *xdg_config = NULL;
- char *user_config = NULL;
-
- home_config_paths(&user_config, &xdg_config, "config");
+ char *xdg_config = xdg_config_home("config");
+ char *user_config = expand_user_path("~/.gitconfig");
if (git_config_system() && !access_or_die(git_etc_gitconfig(), R_OK, 0)) {
ret += git_config_from_file(fn, git_etc_gitconfig(),