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:
Junio C Hamano
2007-02-13 16:50:32 -08:00
9 changed files with 19 additions and 15 deletions

View File

@ -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;
}