Skip to content

Commit d136452

Browse files
torvaldsgitster
authored andcommitted
Split up default "user" config parsing into helper routine
This follows the example of the "core" config, and splits out the default "user" config option parsing into a helper routine. Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 806e2ad commit d136452

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

config.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,11 +464,8 @@ static int git_default_core_config(const char *var, const char *value)
464464
return 0;
465465
}
466466

467-
int git_default_config(const char *var, const char *value, void *dummy)
467+
static int git_default_user_config(const char *var, const char *value)
468468
{
469-
if (!prefixcmp(var, "core."))
470-
return git_default_core_config(var, value);
471-
472469
if (!strcmp(var, "user.name")) {
473470
if (!value)
474471
return config_error_nonbool(var);
@@ -487,6 +484,18 @@ int git_default_config(const char *var, const char *value, void *dummy)
487484
return 0;
488485
}
489486

487+
/* Add other config variables here and to Documentation/config.txt. */
488+
return 0;
489+
}
490+
491+
int git_default_config(const char *var, const char *value, void *dummy)
492+
{
493+
if (!prefixcmp(var, "core."))
494+
return git_default_core_config(var, value);
495+
496+
if (!prefixcmp(var, "user."))
497+
return git_default_user_config(var, value);
498+
490499
if (!strcmp(var, "i18n.commitencoding"))
491500
return git_config_string(&git_commit_encoding, var, value);
492501

0 commit comments

Comments
 (0)