зеркало из https://github.com/microsoft/git.git
Merge branch 'vm/octopus-merge-bases-simplify'
* vm/octopus-merge-bases-simplify: get_octopus_merge_bases(): cleanup redundant variable
This commit is contained in:
Коммит
4243b2d1e4
34
commit.c
34
commit.c
|
@ -841,26 +841,26 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co
|
|||
struct commit_list *get_octopus_merge_bases(struct commit_list *in)
|
||||
{
|
||||
struct commit_list *i, *j, *k, *ret = NULL;
|
||||
struct commit_list **pptr = &ret;
|
||||
|
||||
for (i = in; i; i = i->next) {
|
||||
if (!ret)
|
||||
pptr = &commit_list_insert(i->item, pptr)->next;
|
||||
else {
|
||||
struct commit_list *new = NULL, *end = NULL;
|
||||
if (!in)
|
||||
return ret;
|
||||
|
||||
for (j = ret; j; j = j->next) {
|
||||
struct commit_list *bases;
|
||||
bases = get_merge_bases(i->item, j->item, 1);
|
||||
if (!new)
|
||||
new = bases;
|
||||
else
|
||||
end->next = bases;
|
||||
for (k = bases; k; k = k->next)
|
||||
end = k;
|
||||
}
|
||||
ret = new;
|
||||
commit_list_insert(in->item, &ret);
|
||||
|
||||
for (i = in->next; i; i = i->next) {
|
||||
struct commit_list *new = NULL, *end = NULL;
|
||||
|
||||
for (j = ret; j; j = j->next) {
|
||||
struct commit_list *bases;
|
||||
bases = get_merge_bases(i->item, j->item, 1);
|
||||
if (!new)
|
||||
new = bases;
|
||||
else
|
||||
end->next = bases;
|
||||
for (k = bases; k; k = k->next)
|
||||
end = k;
|
||||
}
|
||||
ret = new;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче