summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2021-08-14 21:40:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-08-15 16:44:08 (GMT)
commit8ef6aad664715c16caf6e36a7f6b174a06574477 (patch)
tree96e439d18259f1fcc2262478b9b5a7c3113b4231 /builtin/commit.c
parent5d213e46bb7b880238ff5ea3914e940a50ae9369 (diff)
downloadgit-8ef6aad664715c16caf6e36a7f6b174a06574477.zip
git-8ef6aad664715c16caf6e36a7f6b174a06574477.tar.gz
git-8ef6aad664715c16caf6e36a7f6b174a06574477.tar.bz2
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 <the_jk@spawned.biz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
-rw-r--r--builtin/commit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 243c626..7c9b1e7 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);