Skip to content

Commit 2f15b6e

Browse files
committed
HACK: sequencer (rebase -i): clean final fixup message
Signed-off-by: Johannes Schindelin <[email protected]>
1 parent ef768a8 commit 2f15b6e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

sequencer.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -607,12 +607,14 @@ int sequencer_commit(const char *defmsg, struct replay_opts *opts,
607607
if (!edit || IS_REBASE_I()) {
608608
argv_array_push(&array, "-F");
609609
argv_array_push(&array, defmsg);
610-
if (!edit && !opts->signoff &&
610+
if (edit < 0)
611+
argv_array_push(&array, "--cleanup=strip");
612+
else if (!edit && !opts->signoff &&
611613
!opts->record_origin &&
612614
git_config_get_value("commit.cleanup", &value))
613615
argv_array_push(&array, "--cleanup=verbatim");
614616
}
615-
if (edit && IS_REBASE_I())
617+
if (edit > 0 && IS_REBASE_I())
616618
argv_array_push(&array, "-e");
617619

618620
if (allow_empty)
@@ -1002,8 +1004,10 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
10021004
amend = 1;
10031005
if (!final_fixup)
10041006
msg_file = squash_msg();
1005-
else if (file_exists(fixup_msg()))
1007+
else if (file_exists(fixup_msg())) {
1008+
edit = -1;
10061009
msg_file = fixup_msg();
1010+
}
10071011
else {
10081012
const char *dest = git_path("SQUASH_MSG");
10091013
unlink(dest);

0 commit comments

Comments
 (0)