diff options
Diffstat (limited to 'revision.c')
| -rw-r--r-- | revision.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/revision.c b/revision.c index 6f8ebc762e..45893651c2 100644 --- a/revision.c +++ b/revision.c @@ -1992,7 +1992,7 @@ static const char *lookup_other_head(struct object_id *oid) static void prepare_show_merge(struct rev_info *revs) { - struct commit_list *bases; + struct commit_list *bases = NULL; struct commit *head, *other; struct object_id oid; const char *other_name; @@ -2007,7 +2007,8 @@ static void prepare_show_merge(struct rev_info *revs) other = lookup_commit_or_die(&oid, other_name); add_pending_object(revs, &head->object, "HEAD"); add_pending_object(revs, &other->object, other_name); - bases = repo_get_merge_bases(the_repository, head, other); + if (repo_get_merge_bases(the_repository, head, other, &bases) < 0) + exit(128); add_rev_cmdline_list(revs, bases, REV_CMD_MERGE_BASE, UNINTERESTING | BOTTOM); add_pending_commit_list(revs, bases, UNINTERESTING | BOTTOM); free_commit_list(bases); @@ -2095,14 +2096,17 @@ static int handle_dotdot_1(const char *arg, char *dotdot, } else { /* A...B -- find merge bases between the two */ struct commit *a, *b; - struct commit_list *exclude; + struct commit_list *exclude = NULL; a = lookup_commit_reference(revs->repo, &a_obj->oid); b = lookup_commit_reference(revs->repo, &b_obj->oid); if (!a || !b) return dotdot_missing(arg, dotdot, revs, symmetric); - exclude = repo_get_merge_bases(the_repository, a, b); + if (repo_get_merge_bases(the_repository, a, b, &exclude) < 0) { + free_commit_list(exclude); + return -1; + } add_rev_cmdline_list(revs, exclude, REV_CMD_MERGE_BASE, flags_exclude); add_pending_commit_list(revs, exclude, flags_exclude); |
