aboutsummaryrefslogtreecommitdiffstats
path: root/sequencer.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-02-27 15:23:00 -0800
committerJunio C Hamano <gitster@pobox.com>2025-02-27 15:23:00 -0800
commitc51a0b47c91106ff50a2a9dca302e80bc7049aba (patch)
treea2d4e281d4b84d987d31866bd7b4e8e64b307e48 /sequencer.c
parentMerge branch 'kn/ref-migrate-skip-reflog' (diff)
parentrebase -i: reword empty commit after fast-forward (diff)
downloadgit-c51a0b47c91106ff50a2a9dca302e80bc7049aba.tar.gz
git-c51a0b47c91106ff50a2a9dca302e80bc7049aba.zip
Merge branch 'pw/rebase-i-ff-empty-commit'
"git rebase -i" failed to allow rewording an empty commit that has been fast-forwarded. * pw/rebase-i-ff-empty-commit: rebase -i: reword empty commit after fast-forward
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sequencer.c b/sequencer.c
index 407ee4e90f..ad0ab75c8d 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -2510,9 +2510,15 @@ static int do_pick_commit(struct repository *r,
*check_todo = !!(flags & EDIT_MSG);
if (!res && reword) {
fast_forward_edit:
- res = run_git_commit(NULL, opts, EDIT_MSG |
- VERIFY_MSG | AMEND_MSG |
- (flags & ALLOW_EMPTY));
+ /*
+ * To reword we amend the commit we just
+ * picked or fast-forwarded. As the commit has
+ * already been picked we want to use the same
+ * set of commit flags regardless of how we
+ * got here.
+ */
+ flags = EDIT_MSG | VERIFY_MSG | AMEND_MSG | ALLOW_EMPTY;
+ res = run_git_commit(NULL, opts, flags);
*check_todo = 1;
}
}