-static int do_interactive_rebase(struct replay_opts *opts, unsigned flags,
- const char *switch_to, struct commit *upstream,
- struct commit *onto, const char *onto_name,
- struct object_id *squash_onto, const char *head_name,
- struct commit *restrict_revision, char *raw_strategies,
- struct string_list *commands, unsigned autosquash)
+static void split_exec_commands(const char *cmd, struct string_list *commands)
+{
+ if (cmd && *cmd) {
+ string_list_split(commands, cmd, '\n', -1);
+
+ /* rebase.c adds a new line to cmd after every command,
+ * so here the last command is always empty */
+ string_list_remove_empty_items(commands, 0);
+ }
+}
+
+static int do_interactive_rebase(struct rebase_options *opts, unsigned flags)