If more than one parents in an Octopus merge have the same
origin, ignore later ones because it would not make any
difference in the outcome.
Signed-off-by: Junio C Hamano <junkio@cox.net>
i < MAXPARENT && parent;
parent = parent->next, i++) {
struct commit *p = parent->item;
+ int j, same;
if (parent_origin[i])
continue;
origin_decref(porigin);
goto finish;
}
- parent_origin[i] = porigin;
+ for (j = same = 0; j < i; j++)
+ if (!hashcmp(parent_origin[j]->blob_sha1,
+ porigin->blob_sha1)) {
+ same = 1;
+ break;
+ }
+ if (!same)
+ parent_origin[i] = porigin;
+ else
+ origin_decref(porigin);
}
}