Merge branch 'rs/code-cleaning'
* rs/code-cleaning: fsck: simplify fsck_commit_buffer() by using commit_list_count() commit: use commit_list_append() instead of duplicating its code merge: simplify merge_trivial() by using commit_list_append() use strbuf_addch for adding single characters use strbuf_addbuf for adding strbufs
This commit is contained in:
7
commit.c
7
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;
|
||||
|
Reference in New Issue
Block a user