diff options
Diffstat (limited to 'commit.c')
-rw-r--r-- | commit.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -834,7 +834,7 @@ struct commit_list *get_merge_bases(struct commit *one, struct commit *two, } /* - * Is "commit" a decendant of one of the elements on the "with_commit" list? + * Is "commit" a descendant of one of the elements on the "with_commit" list? */ int is_descendant_of(struct commit *commit, struct commit_list *with_commit) { @@ -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)); + } +} |