From 8ef6aad664715c16caf6e36a7f6b174a06574477 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Sat, 14 Aug 2021 21:40:30 +0000 Subject: commit: restore --edit when combined with --fixup Recent changes to --fixup, adding amend suboption, caused the --edit flag to be ignored as use_editor was always set to zero. Restore edit_flag having higher priority than fixup_message when deciding the value of use_editor by moving the edit flag condition later in the method. Signed-off-by: Joel Klinghed Signed-off-by: Junio C Hamano --- builtin/commit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'builtin') diff --git a/builtin/commit.c b/builtin/commit.c index 243c626307..7c9b1e7be3 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -1253,8 +1253,6 @@ static int parse_and_validate_options(int argc, const char *argv[], if (logfile || have_option_m || use_message) use_editor = 0; - if (0 <= edit_flag) - use_editor = edit_flag; /* Sanity check options */ if (amend && !current_head) @@ -1344,6 +1342,9 @@ static int parse_and_validate_options(int argc, const char *argv[], } } + if (0 <= edit_flag) + use_editor = edit_flag; + cleanup_mode = get_cleanup_mode(cleanup_arg, use_editor); handle_untracked_files_arg(s); -- cgit v1.2.3