mirror of
https://github.com/git/git
synced 2024-08-24 18:26:02 +00:00
get_octopus_merge_bases(): cleanup redundant variable
pptr is needless. Some related code got cleaned as well. Signed-off-by: Vasily Makarov <einmalfel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
44484662d8
commit
6bc76725ea
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 *get_octopus_merge_bases(struct commit_list *in)
|
||||||
{
|
{
|
||||||
struct commit_list *i, *j, *k, *ret = NULL;
|
struct commit_list *i, *j, *k, *ret = NULL;
|
||||||
struct commit_list **pptr = &ret;
|
|
||||||
|
|
||||||
for (i = in; i; i = i->next) {
|
if (!in)
|
||||||
if (!ret)
|
return ret;
|
||||||
pptr = &commit_list_insert(i->item, pptr)->next;
|
|
||||||
else {
|
|
||||||
struct commit_list *new = NULL, *end = NULL;
|
|
||||||
|
|
||||||
for (j = ret; j; j = j->next) {
|
commit_list_insert(in->item, &ret);
|
||||||
struct commit_list *bases;
|
|
||||||
bases = get_merge_bases(i->item, j->item, 1);
|
for (i = in->next; i; i = i->next) {
|
||||||
if (!new)
|
struct commit_list *new = NULL, *end = NULL;
|
||||||
new = bases;
|
|
||||||
else
|
for (j = ret; j; j = j->next) {
|
||||||
end->next = bases;
|
struct commit_list *bases;
|
||||||
for (k = bases; k; k = k->next)
|
bases = get_merge_bases(i->item, j->item, 1);
|
||||||
end = k;
|
if (!new)
|
||||||
}
|
new = bases;
|
||||||
ret = new;
|
else
|
||||||
|
end->next = bases;
|
||||||
|
for (k = bases; k; k = k->next)
|
||||||
|
end = k;
|
||||||
}
|
}
|
||||||
|
ret = new;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue