X-Git-Url: http://git.tremily.us/?a=blobdiff_plain;f=commit.c;h=213bc98c183b820c43c66d67a15133b4a401f6a4;hb=refs%2Fheads%2Fwtk%2Fremove-submodule-init-v0.5;hp=02467676a3e70684065ed668b53e64c1cc561e1e;hpb=92f6e98c69670689c868452a91d9ed1c2c39eac2;p=git.git diff --git a/commit.c b/commit.c index 02467676a..213bc98c1 100644 --- a/commit.c +++ b/commit.c @@ -609,6 +609,7 @@ static struct commit *interesting(struct commit_list *list) return NULL; } +/* all input commits in one and twos[] must have been parsed! */ static struct commit_list *paint_down_to_common(struct commit *one, int n, struct commit **twos) { struct commit_list *list = NULL; @@ -617,6 +618,8 @@ static struct commit_list *paint_down_to_common(struct commit *one, int n, struc one->object.flags |= PARENT1; commit_list_insert_by_date(one, &list); + if (!n) + return list; for (i = 0; i < n; i++) { twos[i]->object.flags |= PARENT2; commit_list_insert_by_date(twos[i], &list); @@ -737,6 +740,8 @@ static int remove_redundant(struct commit **array, int cnt) redundant = xcalloc(cnt, 1); filled_index = xmalloc(sizeof(*filled_index) * (cnt - 1)); + for (i = 0; i < cnt; i++) + parse_commit(array[i]); for (i = 0; i < cnt; i++) { struct commit_list *common;