Skip to content

Commit

Permalink
commit: use commit_list_append() instead of duplicating its code
Browse files Browse the repository at this point in the history
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
René Scharfe authored and Junio C Hamano committed Jul 10, 2014
1 parent 910a09a commit cb979db
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit cb979db

Please sign in to comment.