[PATCH] commit: restore --edit when combined with --fixup
- From
Joel Klinghed via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Aug 11, 2021, 13:49 UTC
- Message-ID
- <pull.1014.git.1628689758413.gitgitgadget@gmail.com>
From: Joel Klinghed <the_jk@spawned.biz>
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 only changing the default if edit_flag is not set.
Signed-off-by: Joel Klinghed <the_jk@spawned.biz>
---
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 only changing the default if
edit_flag is not set.
Signed-off-by: Joel Klinghed the_jk@spawned.bizPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-1014%2Fthejk%2Ffixup_edit-v1 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1014/thejk/fixup_edit-v1 Pull-Request: https://github.com/gitgitgadget/git/pull/1014
builtin/commit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/builtin/commit.c b/builtin/commit.c index 190d215d43b..4c5286840c5 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -1333,7 +1333,8 @@ static int parse_and_validate_options(int argc, const char *argv[], } else { fixup_commit = fixup_message; fixup_prefix = "fixup"; - use_editor = 0; + if (0 > edit_flag) + use_editor = 0; } } base-commit: ebf3c04b262aa27fbb97f8a0156c2347fecafafb
-- gitgitgadget