diff options
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -30,15 +30,12 @@ #include "pager.h" #include "path.h" #include "utf8.h" -#include "dir.h" #include "color.h" -#include "replace-object.h" #include "refs.h" #include "setup.h" #include "strvec.h" #include "trace2.h" #include "wildmatch.h" -#include "worktree.h" #include "ws.h" #include "write-or-die.h" @@ -1386,10 +1383,15 @@ static int git_default_core_config(const char *var, const char *value, return 0; } if (!strcmp(var, "core.checkstat")) { + if (!value) + return config_error_nonbool(var); if (!strcasecmp(value, "default")) check_stat = 1; else if (!strcasecmp(value, "minimal")) check_stat = 0; + else + return error(_("invalid value for '%s': '%s'"), + var, value); } if (!strcmp(var, "core.quotepath")) { @@ -1546,12 +1548,12 @@ static int git_default_core_config(const char *var, const char *value, return 0; } - if (!strcmp(var, "core.checkroundtripencoding")) { - check_roundtrip_encoding = xstrdup(value); - return 0; - } + if (!strcmp(var, "core.checkroundtripencoding")) + return git_config_string(&check_roundtrip_encoding, var, value); if (!strcmp(var, "core.notesref")) { + if (!value) + return config_error_nonbool(var); notes_ref_name = xstrdup(value); return 0; } @@ -1619,6 +1621,8 @@ static int git_default_core_config(const char *var, const char *value, } if (!strcmp(var, "core.createobject")) { + if (!value) + return config_error_nonbool(var); if (!strcmp(value, "rename")) object_creation_mode = OBJECT_CREATION_USES_RENAMES; else if (!strcmp(value, "link")) |