Merge branch 'jc/merge-base' (early part)
This contains an evil merge to fast-import, in order to resolve in_merge_bases() update.
This commit is contained in:
9
commit.c
9
commit.c
@ -1187,14 +1187,17 @@ struct commit_list *get_merge_bases(struct commit *one,
|
||||
return result;
|
||||
}
|
||||
|
||||
int in_merge_bases(struct commit *rev1, struct commit *rev2)
|
||||
int in_merge_bases(struct commit *commit, struct commit **reference, int num)
|
||||
{
|
||||
struct commit_list *bases, *b;
|
||||
int ret = 0;
|
||||
|
||||
bases = get_merge_bases(rev1, rev2, 1);
|
||||
if (num == 1)
|
||||
bases = get_merge_bases(commit, *reference, 1);
|
||||
else
|
||||
die("not yet");
|
||||
for (b = bases; b; b = b->next) {
|
||||
if (!hashcmp(rev1->object.sha1, b->item->object.sha1)) {
|
||||
if (!hashcmp(commit->object.sha1, b->item->object.sha1)) {
|
||||
ret = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user