Browse Source

rev-tree now handles commit problems better

This fixes possible crashes in case of broken commit tree, and makes
rev-tree die in case it cannot parse a given commit.
maint
Petr Baudis 20 years ago committed by Petr Baudis
parent
commit
06cd3b94b2
  1. 6
      rev-tree.c

6
rev-tree.c

@ -51,10 +51,10 @@ void process_commit(unsigned char *sha1) @@ -51,10 +51,10 @@ void process_commit(unsigned char *sha1)
struct commit_list *parents;
struct commit *obj = lookup_commit(sha1);

if (obj->object.parsed)
if (obj && obj->object.parsed)
return;

parse_commit(obj);
if (!obj || parse_commit(obj))
die("unable to parse commit (%s)", sha1_to_hex(sha1));

parents = obj->parents;
while (parents) {

Loading…
Cancel
Save