summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2014-07-10 09:47:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-07-10 21:07:22 (GMT)
commitcb979dbd8fead65e579442c25b620fdc401227b1 (patch)
tree1576eecbd4da234af65e9f3f298a54a584039759 /commit.c
parent910a09a7350a556f7f367680294fca8d05ddc5f5 (diff)
downloadgit-cb979dbd8fead65e579442c25b620fdc401227b1.zip
git-cb979dbd8fead65e579442c25b620fdc401227b1.tar.gz
git-cb979dbd8fead65e579442c25b620fdc401227b1.tar.bz2
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>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/commit.c b/commit.c
index fb7897c..61d2e13 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;