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>

René Scharfe committed Jul 10, 2014 at 11:47 UTC cb979dbd8fead65e579442c25b620fdc401227b1
1 file changed +1 -6
commit.c
+1 -6
@@ -447,12 +447,7 @@ struct commit_list *copy_commit_list(struct commit_list *list)
447 struct commit_list *head = NULL;
448 struct commit_list **pp = &head;
449 while (list) {
450 - struct commit_list *new;
451 - new = xmalloc(sizeof(struct commit_list));
452 - new->item = list->item;
453 - new->next = NULL;
454 - *pp = new;
455 - pp = &new->next;
450 + pp = commit_list_append(list->item, pp);
451 list = list->next;
452 }
453 return head;