t5505: do not assume the "matching" push is the default
[gitweb.git] / commit.c
index 213bc98c183b820c43c66d67a15133b4a401f6a4..e8eb0aec5509a4fd09698bd15a37d1f4e8341f5e 100644 (file)
--- 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));
+       }
+}