summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorMartin Koegler <mkoegler@auto.tuwien.ac.at>2008-02-18 21:47:57 +0100
committerJunio C Hamano <gitster@pobox.com>2008-02-18 19:25:26 -0800
commit172947e645a6c919efb78a246c919d0daaa674f0 (patch)
tree7a65ca5ad0e7de7503761b14130953b363022efc /commit.c
parenta301b0c8f2627f0c0f4c6fd1015c6140a875d0b4 (diff)
downloadgit-172947e645a6c919efb78a246c919d0daaa674f0.tar.gz
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>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/commit.c b/commit.c
index 8b8fb04d1f..70f12664ce 100644
--- a/commit.c
+++ b/commit.c
@@ -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;
@@ -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);
}