diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-02-14 12:57:17 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-02-14 12:57:17 -0800 |
commit | 63d37c3062e13cb2828edf63bc03cce1b6c41fd0 (patch) | |
tree | 058aa2fe3f357e626c3458a89443ea07fa0f5345 /userdiff.c | |
parent | 5f90b6fa0f5cf1d06bc72ffe607be3cd6aa955b5 (diff) | |
parent | 6680a0874f86600cc8b4b5327384934d83d752a8 (diff) | |
download | git-63d37c3062e13cb2828edf63bc03cce1b6c41fd0.tar.gz git-63d37c3062e13cb2828edf63bc03cce1b6c41fd0.tar.xz |
Merge branch 'jk/userdiff-config-simplify'
* jk/userdiff-config-simplify:
drop odd return value semantics from userdiff_config
Diffstat (limited to 'userdiff.c')
-rw-r--r-- | userdiff.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/userdiff.c b/userdiff.c index 76109da4b..1e7184f7f 100644 --- a/userdiff.c +++ b/userdiff.c @@ -210,14 +210,7 @@ static int parse_funcname(struct userdiff_funcname *f, const char *k, if (git_config_string(&f->pattern, k, v) < 0) return -1; f->cflags = cflags; - return 1; -} - -static int parse_string(const char **d, const char *k, const char *v) -{ - if (git_config_string(d, k, v) < 0) - return -1; - return 1; + return 0; } static int parse_tristate(int *b, const char *k, const char *v) @@ -226,13 +219,13 @@ static int parse_tristate(int *b, const char *k, const char *v) *b = -1; else *b = git_config_bool(k, v); - return 1; + return 0; } static int parse_bool(int *b, const char *k, const char *v) { *b = git_config_bool(k, v); - return 1; + return 0; } int userdiff_config(const char *k, const char *v) @@ -246,13 +239,13 @@ int userdiff_config(const char *k, const char *v) if ((drv = parse_driver(k, v, "binary"))) return parse_tristate(&drv->binary, k, v); if ((drv = parse_driver(k, v, "command"))) - return parse_string(&drv->external, k, v); + return git_config_string(&drv->external, k, v); if ((drv = parse_driver(k, v, "textconv"))) - return parse_string(&drv->textconv, k, v); + return git_config_string(&drv->textconv, k, v); if ((drv = parse_driver(k, v, "cachetextconv"))) return parse_bool(&drv->textconv_want_cache, k, v); if ((drv = parse_driver(k, v, "wordregex"))) - return parse_string(&drv->word_regex, k, v); + return git_config_string(&drv->word_regex, k, v); return 0; } |