aboutsummaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2013-10-24 04:53:19 -0400
committerJunio C Hamano <gitster@pobox.com>2013-10-24 15:43:50 -0700
commit5e7d4d3e932432131d0f8f4195e0061ecf644865 (patch)
tree69826f91be44e4096551bc75e884f0f1db7d8db5 /commit.c
parent0064053bd76ba385e1b5d51b6175bc17bc507804 (diff)
downloadgit-5e7d4d3e932432131d0f8f4195e0061ecf644865.tar.gz
git-5e7d4d3e932432131d0f8f4195e0061ecf644865.tar.xz
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>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commit.c b/commit.c
index 26c1d5406..8535e5cf3 100644
--- a/commit.c
+++ b/commit.c
@@ -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;
}