Skip to contentSkip to conversation

commit: use commit_list_append() instead of duplicating its code

PATCH New René Scharfe 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 commit: use commit_list_append() instead of duplicating its code

---
 commit.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
commit.c +1 -6
index fb7897c..61d2e13 100644
@@ -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;
Signature · 1 line
2.0.0