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 /builtin | |
parent | Sync with 1.7.9.1 (diff) | |
parent | drop odd return value semantics from userdiff_config (diff) | |
download | tgif-63d37c3062e13cb2828edf63bc03cce1b6c41fd0.tar.xz |
Merge branch 'jk/userdiff-config-simplify'
* jk/userdiff-config-simplify:
drop odd return value semantics from userdiff_config
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/blame.c | 8 | ||||
-rw-r--r-- | builtin/cat-file.c | 8 | ||||
-rw-r--r-- | builtin/grep.c | 7 |
3 files changed, 4 insertions, 19 deletions
diff --git a/builtin/blame.c b/builtin/blame.c index 5a67c202f0..01956c8081 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -2050,14 +2050,8 @@ static int git_blame_config(const char *var, const char *value, void *cb) return 0; } - switch (userdiff_config(var, value)) { - case 0: - break; - case -1: + if (userdiff_config(var, value) < 0) return -1; - default: - return 0; - } return git_default_config(var, value, cb); } diff --git a/builtin/cat-file.c b/builtin/cat-file.c index 07bd984084..8ed501f220 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@ -226,14 +226,8 @@ static const char * const cat_file_usage[] = { static int git_cat_file_config(const char *var, const char *value, void *cb) { - switch (userdiff_config(var, value)) { - case 0: - break; - case -1: + if (userdiff_config(var, value) < 0) return -1; - default: - return 0; - } return git_default_config(var, value, cb); } diff --git a/builtin/grep.c b/builtin/grep.c index 5c2ae94e55..dc6de83ab7 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -325,11 +325,8 @@ static int grep_config(const char *var, const char *value, void *cb) struct grep_opt *opt = cb; char *color = NULL; - switch (userdiff_config(var, value)) { - case 0: break; - case -1: return -1; - default: return 0; - } + if (userdiff_config(var, value) < 0) + return -1; if (!strcmp(var, "grep.extendedregexp")) { if (git_config_bool(var, value)) |