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>
This commit is contained in:
Martin Koegler 2008-02-18 21:47:57 +01:00 коммит произвёл Junio C Hamano
Родитель a301b0c8f2
Коммит 172947e645
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -552,8 +552,10 @@ static struct commit_list *merge_bases(struct commit *one, struct commit *two)
*/ */
return commit_list_insert(one, &result); return commit_list_insert(one, &result);
parse_commit(one); if (parse_commit(one))
parse_commit(two); return NULL;
if (parse_commit(two))
return NULL;
one->object.flags |= PARENT1; one->object.flags |= PARENT1;
two->object.flags |= PARENT2; two->object.flags |= PARENT2;
@ -586,7 +588,8 @@ static struct commit_list *merge_bases(struct commit *one, struct commit *two)
parents = parents->next; parents = parents->next;
if ((p->object.flags & flags) == flags) if ((p->object.flags & flags) == flags)
continue; continue;
parse_commit(p); if (parse_commit(p))
return NULL;
p->object.flags |= flags; p->object.flags |= flags;
insert_by_date(p, &list); insert_by_date(p, &list);
} }