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>
This commit is contained in:
parent
e8b32e0610
commit
2c778210f8
9
diff.c
9
diff.c
@ -166,13 +166,8 @@ int git_diff_ui_config(const char *var, const char *value)
|
|||||||
if (!prefixcmp(var, "diff.")) {
|
if (!prefixcmp(var, "diff.")) {
|
||||||
const char *ep = strrchr(var, '.');
|
const char *ep = strrchr(var, '.');
|
||||||
|
|
||||||
if (ep != var + 4) {
|
if (ep != var + 4 && !strcmp(ep, ".command"))
|
||||||
if (!strcmp(ep, ".command")) {
|
return parse_lldiff_command(var, ep, value);
|
||||||
if (!value)
|
|
||||||
return config_error_nonbool(var);
|
|
||||||
return parse_lldiff_command(var, ep, value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return git_diff_basic_config(var, value);
|
return git_diff_basic_config(var, value);
|
||||||
|
Loading…
Reference in New Issue
Block a user