assume parse_commit checks for NULL commit

The parse_commit function will check whether it was passed a
NULL commit pointer, and if so, return an error. There is no
need for callers to check this separately.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King
2013-10-24 04:53:19 -04:00
committed by Junio C Hamano
parent 0064053bd7
commit 5e7d4d3e93
5 changed files with 5 additions and 7 deletions

View File

@ -79,7 +79,7 @@ struct commit *lookup_commit_reference_by_name(const char *name)
if (get_sha1_committish(name, sha1))
return NULL;
commit = lookup_commit_reference(sha1);
if (!commit || parse_commit(commit))
if (parse_commit(commit))
return NULL;
return commit;
}