Skip to content

Commit 870a042

Browse files
committed
Merge branch 'ly/sequencer-update-squash-is-fixup-only'
Code clean-up. * ly/sequencer-update-squash-is-fixup-only: sequencer: replace error() with BUG() in update_squash_messages ()
2 parents 4fd5b1d + 8b34b6a commit 870a042

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sequencer.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2067,6 +2067,9 @@ static int update_squash_messages(struct repository *r,
20672067
const char *message, *body;
20682068
const char *encoding = get_commit_output_encoding();
20692069

2070+
if (!is_fixup(command))
2071+
BUG("not a FIXUP or SQUASH %d", command);
2072+
20702073
if (ctx->current_fixup_count > 0) {
20712074
struct strbuf header = STRBUF_INIT;
20722075
char *eol;
@@ -2134,8 +2137,7 @@ static int update_squash_messages(struct repository *r,
21342137
strbuf_addstr(&buf, "\n\n");
21352138
strbuf_add_commented_lines(&buf, body, strlen(body),
21362139
comment_line_str);
2137-
} else
2138-
return error(_("unknown command: %d"), command);
2140+
}
21392141
repo_unuse_commit_buffer(r, commit, message);
21402142

21412143
if (!res)

0 commit comments

Comments
 (0)