summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2008-02-16 05:59:53 +0100
committerJunio C Hamano <gitster@pobox.com>2008-02-15 21:24:53 -0800
commit2c778210f8877e8f5c88715c2d25d1a43d976566 (patch)
tree1e15f4f547dc8c319f32d282e8f3af14ebeae15a /diff.c
parente8b32e061006d1a62e464e7c2a5385ddd0cb4290 (diff)
downloadgit-2c778210f8877e8f5c88715c2d25d1a43d976566.tar.gz
diff.c: remove useless check for value != NULL
It is not necessary to check if value != NULL before calling 'parse_lldiff_command' as there is already a check inside this function. By the way this patch also improves the existing check inside 'parse_lldiff_command' by using: return config_error_nonbool(var); instead of: return error("%s: lacks value", var); Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/diff.c b/diff.c
index 047310fc94..ed41ce418e 100644
--- a/diff.c
+++ b/diff.c
@@ -166,13 +166,8 @@ int git_diff_ui_config(const char *var, const char *value)
if (!prefixcmp(var, "diff.")) {
const char *ep = strrchr(var, '.');
- if (ep != var + 4) {
- if (!strcmp(ep, ".command")) {
- if (!value)
- return config_error_nonbool(var);
- return parse_lldiff_command(var, ep, value);
- }
- }
+ if (ep != var + 4 && !strcmp(ep, ".command"))
+ return parse_lldiff_command(var, ep, value);
}
return git_diff_basic_config(var, value);