#define EDIT_MSG (1<<1)
#define AMEND_MSG (1<<2)
#define CLEANUP_MSG (1<<3)
+#define VERIFY_MSG (1<<4)
/*
* If we are cherry-pick, and if the merge did not result in
}
argv_array_push(&cmd.args, "commit");
- argv_array_push(&cmd.args, "-n");
+ if (!(flags & VERIFY_MSG))
+ argv_array_push(&cmd.args, "-n");
if ((flags & AMEND_MSG))
argv_array_push(&cmd.args, "--amend");
if (opts->gpg_sign)
if (res || command != TODO_REWORD)
goto leave;
flags |= EDIT_MSG | AMEND_MSG;
+ if (command == TODO_REWORD)
+ flags |= VERIFY_MSG;
msg_file = NULL;
goto fast_forward_edit;
}
}
if (command == TODO_REWORD)
- flags |= EDIT_MSG;
+ flags |= EDIT_MSG | VERIFY_MSG;
else if (is_fixup(command)) {
if (update_squash_messages(command, commit, opts))
return -1;
REWORD_EDITOR="$(pwd)/reword-editor"
export REWORD_EDITOR
-test_expect_failure 'hook is called for reword during `rebase -i`' '
+test_expect_success 'hook is called for reword during `rebase -i`' '
GIT_SEQUENCE_EDITOR="\"$REWORD_EDITOR\"" git rebase -i HEAD^ &&
commit_msg_is "new message"