aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-06-17 10:44:40 -0700
committerJunio C Hamano <gitster@pobox.com>2025-06-17 10:44:40 -0700
commit870a0421c435e956d73aa9c8458788ac29d44ca3 (patch)
tree309bd1fc462234e026d3d4a3b2f42e4a42950334
parentMerge branch 'vd/cat-file-objectmode-update' (diff)
parentsequencer: replace error() with BUG() in update_squash_messages () (diff)
downloadgit-870a0421c435e956d73aa9c8458788ac29d44ca3.tar.gz
git-870a0421c435e956d73aa9c8458788ac29d44ca3.zip
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 ()
-rw-r--r--sequencer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sequencer.c b/sequencer.c
index 1ee0abbd45..9456ca6ee9 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -2067,6 +2067,9 @@ static int update_squash_messages(struct repository *r,
const char *message, *body;
const char *encoding = get_commit_output_encoding();
+ if (!is_fixup(command))
+ BUG("not a FIXUP or SQUASH %d", command);
+
if (ctx->current_fixup_count > 0) {
struct strbuf header = STRBUF_INIT;
char *eol;
@@ -2134,8 +2137,7 @@ static int update_squash_messages(struct repository *r,
strbuf_addstr(&buf, "\n\n");
strbuf_add_commented_lines(&buf, body, strlen(body),
comment_line_str);
- } else
- return error(_("unknown command: %d"), command);
+ }
repo_unuse_commit_buffer(r, commit, message);
if (!res)