diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-07-16 11:33:09 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-07-16 11:33:09 -0700 |
commit | 1fc83452c76e65385b3da69ea94eb957e36e6c78 (patch) | |
tree | 6d6105b9a9fed643036df3d0fceabde1ab1479c7 /commit.c | |
parent | f357797678aa5ae35c63623b8b76eb682d5b9b79 (diff) | |
parent | 9d02150cf4d833935161ef265e4dc03807caa800 (diff) | |
download | git-1fc83452c76e65385b3da69ea94eb957e36e6c78.tar.gz |
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
Diffstat (limited to 'commit.c')
-rw-r--r-- | commit.c | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -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; |