struct commit *one, int n,
struct commit **twos,
timestamp_t min_generation,
- int ignore_missing_commits,
+ enum merge_base_flags mb_flags,
struct commit_list **result)
{
struct prio_queue queue = { compare_commits_by_gen_then_commit_date };
* corrupt commits would already have been
* dispatched with a `die()`.
*/
- if (ignore_missing_commits)
+ if (mb_flags & MERGE_BASE_IGNORE_MISSING_COMMITS)
return 0;
return error(_("could not parse commit %s"),
oid_to_hex(&p->object.oid));
static int merge_bases_many(struct repository *r,
struct commit *one, int n,
struct commit **twos,
+ enum merge_base_flags mb_flags,
struct commit_list **result)
{
struct commit_list *list = NULL, **tail = result;
oid_to_hex(&twos[i]->object.oid));
}
- if (paint_down_to_common(r, one, n, twos, 0, 0, &list)) {
+ if (paint_down_to_common(r, one, n, twos, 0, mb_flags, &list)) {
commit_list_free(list);
return -1;
}
size_t n,
struct commit **twos,
int cleanup,
+ enum merge_base_flags mb_flags,
struct commit_list **result)
{
struct commit_list *list, **tail = result;
size_t cnt, i;
int ret;
- if (merge_bases_many(r, one, n, twos, result) < 0)
+ if (merge_bases_many(r, one, n, twos, mb_flags, result) < 0)
return -1;
for (i = 0; i < n; i++) {
if (one == twos[i])
struct commit **twos,
struct commit_list **result)
{
- return get_merge_bases_many_0(r, one, n, twos, 1, result);
+ return get_merge_bases_many_0(r, one, n, twos, 1, 0, result);
}
int repo_get_merge_bases_many_dirty(struct repository *r,
struct commit *one,
size_t n,
struct commit **twos,
+ enum merge_base_flags mb_flags,
struct commit_list **result)
{
- return get_merge_bases_many_0(r, one, n, twos, 0, result);
+ return get_merge_bases_many_0(r, one, n, twos, 0, mb_flags, result);
}
int repo_get_merge_bases(struct repository *r,
struct commit *two,
struct commit_list **result)
{
- return get_merge_bases_many_0(r, one, 1, &two, 1, result);
+ return get_merge_bases_many_0(r, one, 1, &two, 1, 0, result);
}
/*
struct commit_list *bases = NULL;
int ret = 0, i;
timestamp_t generation, max_generation = GENERATION_NUMBER_ZERO;
+ enum merge_base_flags mb_flags = 0;
+
+ if (ignore_missing_commits)
+ mb_flags |= MERGE_BASE_IGNORE_MISSING_COMMITS;
if (repo_parse_commit(r, commit))
return ignore_missing_commits ? 0 : -1;
if (paint_down_to_common(r, commit,
nr_reference, reference,
- generation, ignore_missing_commits, &bases))
+ generation, mb_flags, &bases))
ret = -1;
else if (commit->object.flags & PARENT2)
ret = 1;