Skip to content

Commit 18256a9

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

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

commit-reach.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ static struct commit_list *paint_down_to_common(struct repository *r,
9595
return result;
9696
}
9797

98-
static struct commit_list *merge_bases_many(struct commit *one, int n, struct commit **twos)
98+
static struct commit_list *merge_bases_many(struct repository *r,
99+
struct commit *one, int n,
100+
struct commit **twos)
99101
{
100102
struct commit_list *list = NULL;
101103
struct commit_list *result = NULL;
@@ -110,14 +112,14 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co
110112
return commit_list_insert(one, &result);
111113
}
112114

113-
if (parse_commit(one))
115+
if (repo_parse_commit(r, one))
114116
return NULL;
115117
for (i = 0; i < n; i++) {
116-
if (parse_commit(twos[i]))
118+
if (repo_parse_commit(r, twos[i]))
117119
return NULL;
118120
}
119121

120-
list = paint_down_to_common(the_repository, one, n, twos, 0);
122+
list = paint_down_to_common(r, one, n, twos, 0);
121123

122124
while (list) {
123125
struct commit *commit = pop_commit(&list);
@@ -224,7 +226,7 @@ static struct commit_list *get_merge_bases_many_0(struct commit *one,
224226
struct commit_list *result;
225227
int cnt, i;
226228

227-
result = merge_bases_many(one, n, twos);
229+
result = merge_bases_many(the_repository, one, n, twos);
228230
for (i = 0; i < n; i++) {
229231
if (one == twos[i])
230232
return result;

0 commit comments

Comments
 (0)