summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorPaul Tan <pyokagan@gmail.com>2015-05-06 08:01:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-05-06 18:33:42 (GMT)
commite682c9db1a7c6a81bb4c2e8e8c1d5191dae3bd9f (patch)
treef0a5f48040e9fadf20397157f78b5c6fa1229bc9 /builtin/commit.c
parent64ab71db3a7e5b41a37580f8a3d15cb25b3e7093 (diff)
downloadgit-e682c9db1a7c6a81bb4c2e8e8c1d5191dae3bd9f.zip
git-e682c9db1a7c6a81bb4c2e8e8c1d5191dae3bd9f.tar.gz
git-e682c9db1a7c6a81bb4c2e8e8c1d5191dae3bd9f.tar.bz2
git-commit: replace use of home_config_paths()
Since home_config_paths() combines two 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 'builtin/commit.c')
-rw-r--r--builtin/commit.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 7d90c35..b4aaaab 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1402,12 +1402,10 @@ int cmd_status(int argc, const char **argv, const char *prefix)
static const char *implicit_ident_advice(void)
{
- char *user_config = NULL;
- char *xdg_config = NULL;
- int config_exists;
+ char *user_config = expand_user_path("~/.gitconfig");
+ char *xdg_config = xdg_config_home("config");
+ int config_exists = file_exists(user_config) || file_exists(xdg_config);
- home_config_paths(&user_config, &xdg_config, "config");
- config_exists = file_exists(user_config) || file_exists(xdg_config);
free(user_config);
free(xdg_config);