Skip to content

Commit ed8a0e3

Browse files
stefanbellergitster
authored andcommitted
commit-reach.c: allow remove_redundant to handle any repo
Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 18256a9 commit ed8a0e3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

commit-reach.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ struct commit_list *get_octopus_merge_bases(struct commit_list *in)
156156
return ret;
157157
}
158158

159-
static int remove_redundant(struct commit **array, int cnt)
159+
static int remove_redundant(struct repository *r, struct commit **array, int cnt)
160160
{
161161
/*
162162
* Some commit in the array may be an ancestor of
@@ -174,7 +174,7 @@ static int remove_redundant(struct commit **array, int cnt)
174174
ALLOC_ARRAY(filled_index, cnt - 1);
175175

176176
for (i = 0; i < cnt; i++)
177-
parse_commit(array[i]);
177+
repo_parse_commit(r, array[i]);
178178
for (i = 0; i < cnt; i++) {
179179
struct commit_list *common;
180180
uint32_t min_generation = array[i]->generation;
@@ -190,7 +190,7 @@ static int remove_redundant(struct commit **array, int cnt)
190190
if (array[j]->generation < min_generation)
191191
min_generation = array[j]->generation;
192192
}
193-
common = paint_down_to_common(the_repository, array[i], filled,
193+
common = paint_down_to_common(r, array[i], filled,
194194
work, min_generation);
195195
if (array[i]->object.flags & PARENT2)
196196
redundant[i] = 1;
@@ -249,7 +249,7 @@ static struct commit_list *get_merge_bases_many_0(struct commit *one,
249249
clear_commit_marks(one, all_flags);
250250
clear_commit_marks_many(n, twos, all_flags);
251251

252-
cnt = remove_redundant(rslt, cnt);
252+
cnt = remove_redundant(the_repository, rslt, cnt);
253253
result = NULL;
254254
for (i = 0; i < cnt; i++)
255255
commit_list_insert_by_date(rslt[i], &result);
@@ -370,7 +370,7 @@ struct commit_list *reduce_heads(struct commit_list *heads)
370370
p->item->object.flags &= ~STALE;
371371
}
372372
}
373-
num_head = remove_redundant(array, num_head);
373+
num_head = remove_redundant(the_repository, array, num_head);
374374
for (i = 0; i < num_head; i++)
375375
tail = &commit_list_insert(array[i], tail)->next;
376376
free(array);

0 commit comments

Comments
 (0)