commit: move reverse_commit_list() from merge-recursive
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
c5a6f65527
commit
b0ca120554
11
commit.c
11
commit.c
@ -563,6 +563,17 @@ struct commit_list *copy_commit_list(struct commit_list *list)
|
||||
return head;
|
||||
}
|
||||
|
||||
struct commit_list *reverse_commit_list(struct commit_list *list)
|
||||
{
|
||||
struct commit_list *next = NULL, *current, *backup;
|
||||
for (current = list; current; current = backup) {
|
||||
backup = current->next;
|
||||
current->next = next;
|
||||
next = current;
|
||||
}
|
||||
return next;
|
||||
}
|
||||
|
||||
void free_commit_list(struct commit_list *list)
|
||||
{
|
||||
while (list)
|
||||
|
Reference in New Issue
Block a user