Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2023-12-07 10:24:04 +0300
committerJunio C Hamano <gitster@pobox.com>2023-12-09 02:26:21 +0300
commit41f98fae0224c2d7043376a9c421b4e0e73cdd82 (patch)
tree6d8efe76210cfb9dc176146b548acf7008990f64 /config.c
parentd49cb162fa752d62cf20548ae057471d348e42ae (diff)
config: reject bogus values for core.checkstat
If you feed nonsense config like: git -c core.checkstat=foobar status we'll silently ignore the unknown value, rather than reporting an error. This goes all the way back to c08e4d5b5c (Enable minimal stat checking, 2013-01-22). Detecting and complaining now is technically a backwards-incompatible change, but I don't think anybody has any reason to use an invalid value here. There are no historical values we'd want to allow for backwards compatibility or anything like that. We are better off loudly telling the user that their config may not be doing what they expect. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.c')
-rw-r--r--config.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/config.c b/config.c
index 18085c7e38..d997c55e33 100644
--- a/config.c
+++ b/config.c
@@ -1392,6 +1392,9 @@ static int git_default_core_config(const char *var, const char *value,
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")) {