Skip to content

Commit

Permalink
check results of parse_commit in merge_bases
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Martin Koegler authored and gitster committed Feb 19, 2008
1 parent a301b0c commit 172947e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,10 @@ static struct commit_list *merge_bases(struct commit *one, struct commit *two)
*/
return commit_list_insert(one, &result);

parse_commit(one);
parse_commit(two);
if (parse_commit(one))
return NULL;
if (parse_commit(two))
return NULL;

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

0 comments on commit 172947e

Please sign in to comment.