config: use config_error_nonbool() instead of custom messages

A few config callbacks use their own custom messages to report an
unexpected implicit bool like:

  [merge "foo"]
  driver

These should just use config_error_nonbool(), so the user sees
consistent messages.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King
2023-12-07 02:25:16 -05:00
committed by Junio C Hamano
parent 0dda4ce9f6
commit 92cecce0de
3 changed files with 3 additions and 3 deletions

View File

@ -1346,7 +1346,7 @@ static int git_imap_config(const char *var, const char *val,
server.port = git_config_int(var, val, ctx->kvi); server.port = git_config_int(var, val, ctx->kvi);
else if (!strcmp("imap.host", var)) { else if (!strcmp("imap.host", var)) {
if (!val) { if (!val) {
return error("Missing value for 'imap.host'"); return config_error_nonbool(var);
} else { } else {
if (starts_with(val, "imap:")) if (starts_with(val, "imap:"))
val += 5; val += 5;

View File

@ -301,7 +301,7 @@ static int read_merge_config(const char *var, const char *value,
if (!strcmp("driver", key)) { if (!strcmp("driver", key)) {
if (!value) if (!value)
return error("%s: lacks value", var); return config_error_nonbool(var);
/* /*
* merge.<name>.driver specifies the command line: * merge.<name>.driver specifies the command line:
* *

View File

@ -314,7 +314,7 @@ int git_xmerge_config(const char *var, const char *value,
{ {
if (!strcmp(var, "merge.conflictstyle")) { if (!strcmp(var, "merge.conflictstyle")) {
if (!value) if (!value)
return error(_("'%s' is not a boolean"), var); return config_error_nonbool(var);
if (!strcmp(value, "diff3")) if (!strcmp(value, "diff3"))
git_xmerge_style = XDL_MERGE_DIFF3; git_xmerge_style = XDL_MERGE_DIFF3;
else if (!strcmp(value, "zdiff3")) else if (!strcmp(value, "zdiff3"))