diff options
author | Elijah Newren <newren@gmail.com> | 2020-12-16 22:27:59 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-12-16 21:56:39 -0800 |
commit | b0ca120554be8d8f7faf98aa3b991441de76f5cf (patch) | |
tree | 2b77aee65ec174e812abc04053d38486c30a7f0e /commit.c | |
parent | merge-ort: add modify/delete handling and delayed output processing (diff) | |
download | tgif-b0ca120554be8d8f7faf98aa3b991441de76f5cf.tar.xz |
commit: move reverse_commit_list() from merge-recursive
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
-rw-r--r-- | commit.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -563,6 +563,17 @@ struct commit_list *copy_commit_list(struct commit_list *list) return head; } +struct commit_list *reverse_commit_list(struct commit_list *list) +{ + struct commit_list *next = NULL, *current, *backup; + for (current = list; current; current = backup) { + backup = current->next; + current->next = next; + next = current; + } + return next; +} + void free_commit_list(struct commit_list *list) { while (list) |