summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-06-18 14:40:35 -0700
committerJunio C Hamano <gitster@pobox.com>2008-06-18 16:50:23 -0700
commitd1364529d06e5fa3bc054396299944a7a4861776 (patch)
tree88d3aa3d24e91efc272a421276f66451f176e578 /config.c
parent806e2ad7fe2d94e1ecae904c33b822b3dfac57f6 (diff)
downloadgit-d1364529d06e5fa3bc054396299944a7a4861776.tar.gz
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 <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.c')
-rw-r--r--config.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/config.c b/config.c
index c3597e0432..ee7642bf6c 100644
--- a/config.c
+++ b/config.c
@@ -464,11 +464,8 @@ static int git_default_core_config(const char *var, const char *value)
return 0;
}
-int git_default_config(const char *var, const char *value, void *dummy)
+static int git_default_user_config(const char *var, const char *value)
{
- if (!prefixcmp(var, "core."))
- return git_default_core_config(var, value);
-
if (!strcmp(var, "user.name")) {
if (!value)
return config_error_nonbool(var);
@@ -487,6 +484,18 @@ int git_default_config(const char *var, const char *value, void *dummy)
return 0;
}
+ /* Add other config variables here and to Documentation/config.txt. */
+ return 0;
+}
+
+int git_default_config(const char *var, const char *value, void *dummy)
+{
+ if (!prefixcmp(var, "core."))
+ return git_default_core_config(var, value);
+
+ if (!prefixcmp(var, "user."))
+ return git_default_user_config(var, value);
+
if (!strcmp(var, "i18n.commitencoding"))
return git_config_string(&git_commit_encoding, var, value);