Skip to content

Commit e682c9d

Browse files
pyokagangitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 64ab71d commit e682c9d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

builtin/commit.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,12 +1402,10 @@ int cmd_status(int argc, const char **argv, const char *prefix)
14021402

14031403
static const char *implicit_ident_advice(void)
14041404
{
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);
14081408

1409-
home_config_paths(&user_config, &xdg_config, "config");
1410-
config_exists = file_exists(user_config) || file_exists(xdg_config);
14111409
free(user_config);
14121410
free(xdg_config);
14131411

0 commit comments

Comments
 (0)