Thread (23 messages) 23 messages, 3 authors, 2019-11-27
STALE2402d
Revisions (3)
  1. v2 current
  2. v3 [diff vs current]
  3. v4 [diff vs current]

[PATCH v2 4/5] rebase: fill `squash_onto' in get_replay_opts()

From: Alban Gruin <hidden>
Date: 2019-10-07 09:27:07
Subsystem: the rest · Maintainer: Linus Torvalds

Currently, the get_replay_opts() function does not initialise the
`squash_onto' field (which is used for the `--root' mode), only
read_populate_opts() does.  That would lead to incorrect results when
calling pick_commits() without reading the options from the disk first.

Let’s change that.

Signed-off-by: Alban Gruin <redacted>
---
Reworded commit.

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.23.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help