threads / patch / 37079

patchline-log: use commit_list_append() instead of duplicating its code

Subject: [PATCH] line-log: use commit_list_append() instead of duplicating its code

## tl;dr

One message between Jul 8, 2014 and Jul 8, 2014. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

René Scharfe· Jul 8, 2014, 16:23 UTC · lore
Signed-off-by: Rene Scharfe <l.s.r@web.de>
---
 line-log.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
Show changes to line-log.c +1 −3
diff --git a/line-log.c b/line-log.c
index 1500101..afcc98d 100644
--- a/line-log.c
+++ b/line-log.c
@@ -1174,9 +1174,7 @@ static int process_ranges_merge_commit(struct rev_info *rev, struct commit *comm
 			 */
 			add_line_range(rev, parents[i], cand[i]);
 			clear_commit_line_range(rev, commit);
-			commit->parents = xmalloc(sizeof(struct commit_list));
-			commit->parents->item = parents[i];
-			commit->parents->next = NULL;
+			commit_list_append(parents[i], &commit->parents);
 			free(parents);
 			free(cand);
 			free_diffqueues(nparents, diffqueues);
-- 
2.0.0

← back to recent threads