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>
Paul Tan committed
May 6, 2015 at 16:01 UTC
e682c9db1a7c6a81bb4c2e8e8c1d5191dae3bd9f
1 file changed
+3
-5
builtin/commit.c
+3
-5
@@ -1402,12 +1402,10 @@ int cmd_status(int argc, const char **argv, const char *prefix)
1402
1403
static const char *implicit_ident_advice(void)
1404
{
1405
- char *user_config = NULL;
1406
- char *xdg_config = NULL;
1407
- int config_exists;
1405
+ char *user_config = expand_user_path("~/.gitconfig");
1406
+ char *xdg_config = xdg_config_home("config");
1407
+ int config_exists = file_exists(user_config) || file_exists(xdg_config);
1408
1409
- home_config_paths(&user_config, &xdg_config, "config");
1410
- config_exists = file_exists(user_config) || file_exists(xdg_config);
1409
free(user_config);
1410
free(xdg_config);
1411