diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2012-10-26 22:53:51 +0700 |
---|---|---|
committer | Jeff King <peff@peff.net> | 2012-10-29 03:08:30 -0400 |
commit | efc7df454e9ec8b730fb2293c8549cec43de6bfa (patch) | |
tree | bc96070114a2ca5820523944880f635910155d46 /commit.c | |
parent | c43cb38612192fa45bf7ed981a98bc4ddb86ce75 (diff) | |
download | git-efc7df454e9ec8b730fb2293c8549cec43de6bfa.tar.gz |
Move print_commit_list to libgit.a
This is used by bisect.c, part of libgit.a while it stays in
builtin/rev-list.c. Move it to commit.c so that we won't get undefined
reference if a program that uses libgit.a happens to pull it in.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 'commit.c')
-rw-r--r-- | commit.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -1347,3 +1347,13 @@ struct commit_list **commit_list_append(struct commit *commit, new->next = NULL; return &new->next; } + +void print_commit_list(struct commit_list *list, + const char *format_cur, + const char *format_last) +{ + for ( ; list; list = list->next) { + const char *format = list->next ? format_cur : format_last; + printf(format, sha1_to_hex(list->item->object.sha1)); + } +} |