From: René Scharfe Date: Thu, 10 Jul 2014 09:47:47 +0000 (+0200) Subject: commit: use commit_list_append() instead of duplicating its code X-Git-Tag: v2.1.0-rc0~31^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cb979dbd8fead65e579442c25b620fdc401227b1;p=thirdparty%2Fgit.git commit: use commit_list_append() instead of duplicating its code Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- diff --git a/commit.c b/commit.c index fb7897c2a4..61d2e13f48 100644 --- a/commit.c +++ b/commit.c @@ -447,12 +447,7 @@ struct commit_list *copy_commit_list(struct commit_list *list) struct commit_list *head = NULL; struct commit_list **pp = &head; while (list) { - struct commit_list *new; - new = xmalloc(sizeof(struct commit_list)); - new->item = list->item; - new->next = NULL; - *pp = new; - pp = &new->next; + pp = commit_list_append(list->item, pp); list = list->next; } return head;