Skip to content

Commit

Permalink
diff.c: remove useless check for value != NULL
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christian Couder authored and Junio C Hamano committed Feb 16, 2008
1 parent e8b32e0 commit 2c77821
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2c77821

Please sign in to comment.