summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-12-21 22:30:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-12-21 22:30:43 (GMT)
commitf7d07cce82ccdbc3a7cf343943d359287cb19c5a (patch)
treec0b4b2d188802f1846dd8d2558e7a5cf033d3ffb
parent876e78f31d2aa23e9f669a257ddcbf9a7970a958 (diff)
parentdb6195efab70aa3aca1cc8e39855f2cd58e0287b (diff)
downloadgit-f7d07cce82ccdbc3a7cf343943d359287cb19c5a.zip
git-f7d07cce82ccdbc3a7cf343943d359287cb19c5a.tar.gz
git-f7d07cce82ccdbc3a7cf343943d359287cb19c5a.tar.bz2
Merge branch 'jk/maint-decorate-01-bool'
* jk/maint-decorate-01-bool: handle arbitrary ints in git_config_maybe_bool
-rw-r--r--config.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/config.c b/config.c
index 32c0b2c..d73b090 100644
--- a/config.c
+++ b/config.c
@@ -429,13 +429,11 @@ static int git_config_maybe_bool_text(const char *name, const char *value)
int git_config_maybe_bool(const char *name, const char *value)
{
- int v = git_config_maybe_bool_text(name, value);
+ long v = git_config_maybe_bool_text(name, value);
if (0 <= v)
return v;
- if (!strcmp(value, "0"))
- return 0;
- if (!strcmp(value, "1"))
- return 1;
+ if (git_parse_long(value, &v))
+ return !!v;
return -1;
}