commit: use commit_list_append() instead of duplicating its code
Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
910a09a735
commit
cb979dbd8f
7
commit.c
7
commit.c
@ -447,12 +447,7 @@ struct commit_list *copy_commit_list(struct commit_list *list)
|
|||||||
struct commit_list *head = NULL;
|
struct commit_list *head = NULL;
|
||||||
struct commit_list **pp = &head;
|
struct commit_list **pp = &head;
|
||||||
while (list) {
|
while (list) {
|
||||||
struct commit_list *new;
|
pp = commit_list_append(list->item, pp);
|
||||||
new = xmalloc(sizeof(struct commit_list));
|
|
||||||
new->item = list->item;
|
|
||||||
new->next = NULL;
|
|
||||||
*pp = new;
|
|
||||||
pp = &new->next;
|
|
||||||
list = list->next;
|
list = list->next;
|
||||||
}
|
}
|
||||||
return head;
|
return head;
|
||||||
|
Loading…
Reference in New Issue
Block a user