summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-11-14 00:12:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-14 08:22:40 (GMT)
commit18256a915c64ac9b6b7ecec4d4c22b7f6fcca507 (patch)
tree58e5627376bd676bff28cef3f8fc9af40eef6145
parentc383830a91fcaf402db1051a9cec2eb93cdd6b78 (diff)
downloadgit-18256a915c64ac9b6b7ecec4d4c22b7f6fcca507.zip
git-18256a915c64ac9b6b7ecec4d4c22b7f6fcca507.tar.gz
git-18256a915c64ac9b6b7ecec4d4c22b7f6fcca507.tar.bz2
commit-reach.c: allow merge_bases_many to handle any repo
Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--commit-reach.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/commit-reach.c b/commit-reach.c
index 67c2e43..a53b31e 100644
--- a/commit-reach.c
+++ b/commit-reach.c
@@ -95,7 +95,9 @@ static struct commit_list *paint_down_to_common(struct repository *r,
return result;
}
-static struct commit_list *merge_bases_many(struct commit *one, int n, struct commit **twos)
+static struct commit_list *merge_bases_many(struct repository *r,
+ struct commit *one, int n,
+ struct commit **twos)
{
struct commit_list *list = NULL;
struct commit_list *result = NULL;
@@ -110,14 +112,14 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co
return commit_list_insert(one, &result);
}
- if (parse_commit(one))
+ if (repo_parse_commit(r, one))
return NULL;
for (i = 0; i < n; i++) {
- if (parse_commit(twos[i]))
+ if (repo_parse_commit(r, twos[i]))
return NULL;
}
- list = paint_down_to_common(the_repository, one, n, twos, 0);
+ list = paint_down_to_common(r, one, n, twos, 0);
while (list) {
struct commit *commit = pop_commit(&list);
@@ -224,7 +226,7 @@ static struct commit_list *get_merge_bases_many_0(struct commit *one,
struct commit_list *result;
int cnt, i;
- result = merge_bases_many(one, n, twos);
+ result = merge_bases_many(the_repository, one, n, twos);
for (i = 0; i < n; i++) {
if (one == twos[i])
return result;