Skip to content

Commit 92cecce

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0dda4ce commit 92cecce

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

imap-send.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1346,7 +1346,7 @@ static int git_imap_config(const char *var, const char *val,
13461346
server.port = git_config_int(var, val, ctx->kvi);
13471347
else if (!strcmp("imap.host", var)) {
13481348
if (!val) {
1349-
return error("Missing value for 'imap.host'");
1349+
return config_error_nonbool(var);
13501350
} else {
13511351
if (starts_with(val, "imap:"))
13521352
val += 5;

merge-ll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ static int read_merge_config(const char *var, const char *value,
301301

302302
if (!strcmp("driver", key)) {
303303
if (!value)
304-
return error("%s: lacks value", var);
304+
return config_error_nonbool(var);
305305
/*
306306
* merge.<name>.driver specifies the command line:
307307
*

xdiff-interface.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ int git_xmerge_config(const char *var, const char *value,
314314
{
315315
if (!strcmp(var, "merge.conflictstyle")) {
316316
if (!value)
317-
return error(_("'%s' is not a boolean"), var);
317+
return config_error_nonbool(var);
318318
if (!strcmp(value, "diff3"))
319319
git_xmerge_style = XDL_MERGE_DIFF3;
320320
else if (!strcmp(value, "zdiff3"))

0 commit comments

Comments
 (0)