[PATCH v3 4/5] rebase: fill `squash_onto' in get_replay_opts()
From: Alban Gruin <hidden>
Date: 2019-11-23 14:46:35
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Alban Gruin <hidden>
Date: 2019-11-23 14:46:35
Subsystem:
the rest · Maintainer:
Linus Torvalds
When sequencer_continue() is called by complete_action(), `opts' has been filled by get_replay_opts(). Currently, it does not initialise the `squash_onto' field (used by the `--root' mode), only read_populate_opts() does. It’s not a problem yet since sequencer_continue() calls it before pick_commits(), but it would lead to incorrect results once complete_action() is modified to call pick_commits() directly. Let’s change that. Signed-off-by: Alban Gruin <redacted> --- builtin/rebase.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/builtin/rebase.c b/builtin/rebase.c
index e8319d5946..2097d41edc 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c@@ -117,6 +117,11 @@ static struct replay_opts get_replay_opts(const struct rebase_options *opts) if (opts->strategy_opts) parse_strategy_opts(&replay, opts->strategy_opts); + if (opts->squash_onto) { + oidcpy(&replay.squash_onto, opts->squash_onto); + replay.have_squash_onto = 1; + } + return replay; }
--
2.24.0