From: Junio C Hamano Date: Thu, 8 Apr 2021 20:23:25 +0000 (-0700) Subject: Merge branch 'en/sequencer-edit-upon-conflict-fix' X-Git-Tag: v2.32.0-rc0~98 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82fd285e4606b941bd2bf79be700fb0371599c18;p=thirdparty%2Fgit.git Merge branch 'en/sequencer-edit-upon-conflict-fix' "git cherry-pick/revert" with or without "--[no-]edit" did not spawn the editor as expected (e.g. "revert --no-edit" after a conflict still asked to edit the message), which has been corrected. * en/sequencer-edit-upon-conflict-fix: sequencer: fix edit handling for cherry-pick and revert messages --- 82fd285e4606b941bd2bf79be700fb0371599c18 diff --cc sequencer.c index b4c63ae207,8ef597ac3a..fd183b5593 --- a/sequencer.c +++ b/sequencer.c @@@ -2032,8 -1860,20 +2032,19 @@@ static void record_in_rewritten(struct flush_rewritten_pending(); } + static int should_edit(struct replay_opts *opts) { + if (opts->edit < 0) + /* + * Note that we only handle the case of non-conflicted + * commits; continue_single_pick() handles the conflicted + * commits itself instead of calling this function. + */ + return (opts->action == REPLAY_REVERT && isatty(0)) ? 1 : 0; + return opts->edit; + } + static int do_pick_commit(struct repository *r, - enum todo_command command, - struct commit *commit, + struct todo_item *item, struct replay_opts *opts, int final_fixup, int *check_todo) {