@@ -1718,6 +1718,17 @@ static int is_pick_or_similar(enum todo_command command)
}
}
+static void append_squash_message(struct strbuf *buf, const char *body,
+ struct replay_opts *opts)
+{
+ unlink(rebase_path_fixup_msg());
+ strbuf_addf(buf, "\n%c ", comment_line_char);
+ strbuf_addf(buf, _("This is the commit message #%d:"),
+ ++opts->current_fixup_count + 1);
+ strbuf_addstr(buf, "\n\n");
+ strbuf_addstr(buf, body);
+}
+
static int update_squash_messages(struct repository *r,
enum todo_command command,
struct commit *commit,
@@ -1779,12 +1790,7 @@ static int update_squash_messages(struct repository *r,
find_commit_subject(message, &body);
if (command == TODO_SQUASH) {
- unlink(rebase_path_fixup_msg());
- strbuf_addf(&buf, "\n%c ", comment_line_char);
- strbuf_addf(&buf, _("This is the commit message #%d:"),
- ++opts->current_fixup_count + 1);
- strbuf_addstr(&buf, "\n\n");
- strbuf_addstr(&buf, body);
+ append_squash_message(&buf, body, opts);
} else if (command == TODO_FIXUP) {
strbuf_addf(&buf, "\n%c ", comment_line_char);
strbuf_addf(&buf, _("The commit message #%d will be skipped:"),