X-Git-Url: http://git.tremily.us/?a=blobdiff_plain;f=commit.c;h=e8eb0aec5509a4fd09698bd15a37d1f4e8341f5e;hb=b141a47801d6fb2d68ec48adfe7597ec3ce49c0d;hp=213bc98c183b820c43c66d67a15133b4a401f6a4;hpb=8c6bda0f4dc7c013fe58f91070164ba8c55d2bd0;p=git.git diff --git a/commit.c b/commit.c index 213bc98c1..e8eb0aec5 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)); + } +}