{"thread":{"id":"37094","subject":"[PATCH] commit: use commit_list_append() instead of duplicating its code","startedAt":"2014-07-10T09:47:47Z","lastAt":"2014-07-10T09:47:47Z","messageCount":1,"participants":["René Scharfe"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"245687","messageId":"53BE6143.1000507@web.de","threadId":"37094","inReplyTo":null,"subject":"[PATCH] commit: use commit_list_append() instead of duplicating its code","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2014-07-10T09:47:47Z","receivedAt":"2014-07-10T09:47:47Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Signed-off-by: Rene Scharfe <l.s.r@web.de>\n---\n commit.c | 7 +------\n 1 file changed, 1 insertion(+), 6 deletions(-)\n\ndiff --git a/commit.c b/commit.c\nindex fb7897c..61d2e13 100644\n--- a/commit.c\n+++ b/commit.c\n@@ -447,12 +447,7 @@ struct commit_list *copy_commit_list(struct commit_list *list)\n \tstruct commit_list *head = NULL;\n \tstruct commit_list **pp = &head;\n \twhile (list) {\n-\t\tstruct commit_list *new;\n-\t\tnew = xmalloc(sizeof(struct commit_list));\n-\t\tnew->item = list->item;\n-\t\tnew->next = NULL;\n-\t\t*pp = new;\n-\t\tpp = &new->next;\n+\t\tpp = commit_list_append(list->item, pp);\n \t\tlist = list->next;\n \t}\n \treturn head;\n-- \n2.0.0\n"}]}