Junio C Hamano [off-list ref] writes:
for (i = 0; i < cnt; i++) {
- if (rslt[i])
+ /*
+ * Is rslt[i] an ancestor of any of the others?
+ * then it is not interesting to us.
+ */
+ for (j = 0; j < i; j++)
+ others[j] = rslt[j];
+ for (j = 1 + 1; j < cnt; j++)
s/1 + 1/i + 1/;
With that, all tests seem to pass ;-)
+ others[j - 1] = rslt[j];
+ list = merge_bases_many(rslt[i], cnt - 1, others);
+ clear_commit_marks(rslt[i], all_flags);
+ for (j = 0; j < cnt - 1; j++)
+ clear_commit_marks(others[j], all_flags);
+ while (list) {
+ if (rslt[i] == list->item)
+ break;
+ list = list->next;
+ }
+ if (!list)
commit_list_insert_by_date(rslt[i], &result);
+ free_commit_list(list);
}
free(rslt);
+ free(others);
return result;
}