Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
commit-reach.c: allow paint_down_to_common to handle any repo
author
Stefan Beller
<sbeller@google.com>
Wed, 14 Nov 2018 00:12:51 +0000
(16:12 -0800)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 14 Nov 2018 08:22:40 +0000
(17:22 +0900)
As the function is file local and not widely used, migrate it all at once.
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-reach.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
9e5252a
)
diff --git
a/commit-reach.c
b/commit-reach.c
index 9f79ce0a22946174376d247127027e4a0ad3c1e9..67c2e43d5e3cc20e988df000b814c690978a027c 100644
(file)
--- a/
commit-reach.c
+++ b/
commit-reach.c
@@
-30,7
+30,8
@@
static int queue_has_nonstale(struct prio_queue *queue)
}
/* all input commits in one and twos[] must have been parsed! */
}
/* all input commits in one and twos[] must have been parsed! */
-static struct commit_list *paint_down_to_common(struct commit *one, int n,
+static struct commit_list *paint_down_to_common(struct repository *r,
+ struct commit *one, int n,
struct commit **twos,
int min_generation)
{
struct commit **twos,
int min_generation)
{
@@
-83,7
+84,7
@@
static struct commit_list *paint_down_to_common(struct commit *one, int n,
parents = parents->next;
if ((p->object.flags & flags) == flags)
continue;
parents = parents->next;
if ((p->object.flags & flags) == flags)
continue;
- if (
parse_commit(
p))
+ if (
repo_parse_commit(r,
p))
return NULL;
p->object.flags |= flags;
prio_queue_put(&queue, p);
return NULL;
p->object.flags |= flags;
prio_queue_put(&queue, p);
@@
-116,7
+117,7
@@
static struct commit_list *merge_bases_many(struct commit *one, int n, struct co
return NULL;
}
return NULL;
}
- list = paint_down_to_common(one, n, twos, 0);
+ list = paint_down_to_common(
the_repository,
one, n, twos, 0);
while (list) {
struct commit *commit = pop_commit(&list);
while (list) {
struct commit *commit = pop_commit(&list);
@@
-187,8
+188,8
@@
static int remove_redundant(struct commit **array, int cnt)
if (array[j]->generation < min_generation)
min_generation = array[j]->generation;
}
if (array[j]->generation < min_generation)
min_generation = array[j]->generation;
}
- common = paint_down_to_common(
array[i], filled, work
,
- min_generation);
+ common = paint_down_to_common(
the_repository, array[i], filled
,
+
work,
min_generation);
if (array[i]->object.flags & PARENT2)
redundant[i] = 1;
for (j = 0; j < filled; j++)
if (array[i]->object.flags & PARENT2)
redundant[i] = 1;
for (j = 0; j < filled; j++)
@@
-322,7
+323,9
@@
int in_merge_bases_many(struct commit *commit, int nr_reference, struct commit *
if (commit->generation > min_generation)
return ret;
if (commit->generation > min_generation)
return ret;
- bases = paint_down_to_common(commit, nr_reference, reference, commit->generation);
+ bases = paint_down_to_common(the_repository, commit,
+ nr_reference, reference,
+ commit->generation);
if (commit->object.flags & PARENT2)
ret = 1;
clear_commit_marks(commit, all_flags);
if (commit->object.flags & PARENT2)
ret = 1;
clear_commit_marks(commit, all_flags);