]> git.ipfire.org Git - thirdparty/git.git/commitdiff
rebase: fill `squash_onto' in get_replay_opts()
authorAlban Gruin <alban.gruin@gmail.com>
Sun, 24 Nov 2019 17:43:31 +0000 (18:43 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Nov 2019 03:24:49 +0000 (12:24 +0900)
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 <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rebase.c

index 4a20582e724b00a565ee8b0fd05137a11b27568c..b171c86e3d86142df51bb77cfe6bbaab0bcd37b9 100644 (file)
@@ -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;
 }