Skip to content

Commit f7d07cc

Browse files
committed
Merge branch 'jk/maint-decorate-01-bool'
* jk/maint-decorate-01-bool: handle arbitrary ints in git_config_maybe_bool
2 parents 876e78f + db6195e commit f7d07cc

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

config.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -429,13 +429,11 @@ static int git_config_maybe_bool_text(const char *name, const char *value)
429429

430430
int git_config_maybe_bool(const char *name, const char *value)
431431
{
432-
int v = git_config_maybe_bool_text(name, value);
432+
long v = git_config_maybe_bool_text(name, value);
433433
if (0 <= v)
434434
return v;
435-
if (!strcmp(value, "0"))
436-
return 0;
437-
if (!strcmp(value, "1"))
438-
return 1;
435+
if (git_parse_long(value, &v))
436+
return !!v;
439437
return -1;
440438
}
441439

0 commit comments

Comments
 (0)