File tree Expand file tree Collapse file tree 3 files changed +29
-27
lines changed
Expand file tree Collapse file tree 3 files changed +29
-27
lines changed Original file line number Diff line number Diff line change @@ -1214,3 +1214,30 @@ struct commit *get_merge_parent(const char *name)
12141214 }
12151215 return commit ;
12161216}
1217+
1218+ /*
1219+ * Append a commit to the end of the commit_list.
1220+ *
1221+ * next starts by pointing to the variable that holds the head of an
1222+ * empty commit_list, and is updated to point to the "next" field of
1223+ * the last item on the list as new commits are appended.
1224+ *
1225+ * Usage example:
1226+ *
1227+ * struct commit_list *list;
1228+ * struct commit_list **next = &list;
1229+ *
1230+ * next = commit_list_append(c1, next);
1231+ * next = commit_list_append(c2, next);
1232+ * assert(commit_list_count(list) == 2);
1233+ * return list;
1234+ */
1235+ struct commit_list * * commit_list_append (struct commit * commit ,
1236+ struct commit_list * * next )
1237+ {
1238+ struct commit_list * new = xmalloc (sizeof (struct commit_list ));
1239+ new -> item = commit ;
1240+ * next = new ;
1241+ new -> next = NULL ;
1242+ return & new -> next ;
1243+ }
Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ int find_commit_subject(const char *commit_buffer, const char **subject);
5353
5454struct commit_list * commit_list_insert (struct commit * item ,
5555 struct commit_list * * list );
56+ struct commit_list * * commit_list_append (struct commit * commit ,
57+ struct commit_list * * next );
5658unsigned commit_list_count (const struct commit_list * l );
5759struct commit_list * commit_list_insert_by_date (struct commit * item ,
5860 struct commit_list * * list );
Original file line number Diff line number Diff line change @@ -468,33 +468,6 @@ static void read_and_refresh_cache(struct replay_opts *opts)
468468 rollback_lock_file (& index_lock );
469469}
470470
471- /*
472- * Append a commit to the end of the commit_list.
473- *
474- * next starts by pointing to the variable that holds the head of an
475- * empty commit_list, and is updated to point to the "next" field of
476- * the last item on the list as new commits are appended.
477- *
478- * Usage example:
479- *
480- * struct commit_list *list;
481- * struct commit_list **next = &list;
482- *
483- * next = commit_list_append(c1, next);
484- * next = commit_list_append(c2, next);
485- * assert(commit_list_count(list) == 2);
486- * return list;
487- */
488- static struct commit_list * * commit_list_append (struct commit * commit ,
489- struct commit_list * * next )
490- {
491- struct commit_list * new = xmalloc (sizeof (struct commit_list ));
492- new -> item = commit ;
493- * next = new ;
494- new -> next = NULL ;
495- return & new -> next ;
496- }
497-
498471static int format_todo (struct strbuf * buf , struct commit_list * todo_list ,
499472 struct replay_opts * opts )
500473{
You can’t perform that action at this time.
0 commit comments