summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorLibravatar Johannes Schindelin <johannes.schindelin@gmx.de>2018-10-30 11:40:04 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-10-31 12:46:21 +0900
commit70fc5793dfdf8ba8586ca130674f6896eb3eb37a (patch)
treebd1dd8ab11a2178c92f92d7f6cca7dd029a44d77 /config.c
parentconfig: rename `dummy` parameter to `cb` in git_default_config() (diff)
downloadtgif-70fc5793dfdf8ba8586ca130674f6896eb3eb37a.tar.xz
config: allow for platform-specific core.* config settings
In the Git for Windows project, we have ample precendent for config settings that apply to Windows, and to Windows only. Let's formalize this concept by introducing a platform_core_config() function that can be #define'd in a platform-specific manner. This will allow us to contain platform-specific code better, as the corresponding variables no longer need to be exported so that they can be defined in environment.c and be set in config.c Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.c')
-rw-r--r--config.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/config.c b/config.c
index 3687c6783e..646b6cca96 100644
--- a/config.c
+++ b/config.c
@@ -1093,7 +1093,7 @@ int git_config_color(char *dest, const char *var, const char *value)
return 0;
}
-static int git_default_core_config(const char *var, const char *value)
+static int git_default_core_config(const char *var, const char *value, void *cb)
{
/* This needs a better name */
if (!strcmp(var, "core.filemode")) {
@@ -1363,7 +1363,7 @@ static int git_default_core_config(const char *var, const char *value)
}
/* Add other config variables here and to Documentation/config.txt. */
- return 0;
+ return platform_core_config(var, value, cb);
}
static int git_default_i18n_config(const char *var, const char *value)
@@ -1451,7 +1451,7 @@ static int git_default_mailmap_config(const char *var, const char *value)
int git_default_config(const char *var, const char *value, void *cb)
{
if (starts_with(var, "core."))
- return git_default_core_config(var, value);
+ return git_default_core_config(var, value, cb);
if (starts_with(var, "user."))
return git_ident_config(var, value, cb);