From efc7df454e9ec8b730fb2293c8549cec43de6bfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Fri, 26 Oct 2012 22:53:51 +0700 Subject: Move print_commit_list to libgit.a MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Jeff King --- commit.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'commit.c') diff --git a/commit.c b/commit.c index 213bc98c18..e8eb0aec55 100644 --- a/commit.c +++ b/commit.c @@ -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)); + } +} -- cgit v1.2.3