check results of parse_commit in merge_bases
An error is signaled by returning NULL. Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Martin Koegler committed
Feb 18, 2008 at 21:47 UTC
172947e645a6c919efb78a246c919d0daaa674f0
1 file changed
+6
-3
commit.c
+6
-3
@@ -552,8 +552,10 @@ static struct commit_list *merge_bases(struct commit *one, struct commit *two)
552
*/
553
return commit_list_insert(one, &result);
554
555
- parse_commit(one);
556
- parse_commit(two);
555
+ if (parse_commit(one))
556
+ return NULL;
557
+ if (parse_commit(two))
558
+ return NULL;
559
560
one->object.flags |= PARENT1;
561
two->object.flags |= PARENT2;
@@ -586,7 +588,8 @@ static struct commit_list *merge_bases(struct commit *one, struct commit *two)
588
parents = parents->next;
589
if ((p->object.flags & flags) == flags)
590
continue;
589
- parse_commit(p);
591
+ if (parse_commit(p))
592
+ return NULL;
593
p->object.flags |= flags;
594
insert_by_date(p, &list);
595
}