summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-09-18 11:59:05 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-09-18 11:59:05 -0700
commit6930cd10de930b09639e1dad7ae8d74f9128e404 (patch)
treed3cee943976b69449b939a6aa359c9c4dc8c0f34 /commit.c
parentMerge branch 'jc/transport-do-not-use-connect-twice-in-fetch' into maint (diff)
parentlog: use true parents for diff when walking reflogs (diff)
downloadtgif-6930cd10de930b09639e1dad7ae8d74f9128e404.tar.xz
Merge branch 'tr/log-full-diff-keep-true-parents' into maint
Output from "git log --full-diff -- <pathspec>" looked strange, because comparison was done with the previous ancestor that touched the specified <pathspec>, causing the patches for paths outside the pathspec to show more than the single commit has changed. * tr/log-full-diff-keep-true-parents: log: use true parents for diff when walking reflogs log: use true parents for diff even when rewriting
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/commit.c b/commit.c
index a575564a15..de16a3c0a2 100644
--- a/commit.c
+++ b/commit.c
@@ -377,6 +377,22 @@ unsigned commit_list_count(const struct commit_list *l)
return c;
}
+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;
+ list = list->next;
+ }
+ return head;
+}
+
void free_commit_list(struct commit_list *list)
{
while (list) {