Skip to content

Commit f28e87f

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

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

commit-reach.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ static int remove_redundant(struct repository *r, struct commit **array, int cnt
216216
return filled;
217217
}
218218

219-
static struct commit_list *get_merge_bases_many_0(struct commit *one,
219+
static struct commit_list *get_merge_bases_many_0(struct repository *r,
220+
struct commit *one,
220221
int n,
221222
struct commit **twos,
222223
int cleanup)
@@ -226,7 +227,7 @@ static struct commit_list *get_merge_bases_many_0(struct commit *one,
226227
struct commit_list *result;
227228
int cnt, i;
228229

229-
result = merge_bases_many(the_repository, one, n, twos);
230+
result = merge_bases_many(r, one, n, twos);
230231
for (i = 0; i < n; i++) {
231232
if (one == twos[i])
232233
return result;
@@ -249,7 +250,7 @@ static struct commit_list *get_merge_bases_many_0(struct commit *one,
249250
clear_commit_marks(one, all_flags);
250251
clear_commit_marks_many(n, twos, all_flags);
251252

252-
cnt = remove_redundant(the_repository, rslt, cnt);
253+
cnt = remove_redundant(r, rslt, cnt);
253254
result = NULL;
254255
for (i = 0; i < cnt; i++)
255256
commit_list_insert_by_date(rslt[i], &result);
@@ -261,19 +262,19 @@ struct commit_list *get_merge_bases_many(struct commit *one,
261262
int n,
262263
struct commit **twos)
263264
{
264-
return get_merge_bases_many_0(one, n, twos, 1);
265+
return get_merge_bases_many_0(the_repository, one, n, twos, 1);
265266
}
266267

267268
struct commit_list *get_merge_bases_many_dirty(struct commit *one,
268269
int n,
269270
struct commit **twos)
270271
{
271-
return get_merge_bases_many_0(one, n, twos, 0);
272+
return get_merge_bases_many_0(the_repository, one, n, twos, 0);
272273
}
273274

274275
struct commit_list *get_merge_bases(struct commit *one, struct commit *two)
275276
{
276-
return get_merge_bases_many_0(one, 1, &two, 1);
277+
return get_merge_bases_many_0(the_repository, one, 1, &two, 1);
277278
}
278279

279280
/*

0 commit comments

Comments
 (0)