From 93122c985a3671bd4e15b3dbc6b457c981eb8c23 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Sat, 15 Feb 2020 21:36:29 +0000 Subject: rebase: fix handling of restrict_revision restrict_revision in the original shell script was an excluded revision range. It is also treated that way by the am-backend. In the conversion from shell to C (see commit 6ab54d17be3f ("rebase -i: implement the logic to initialize $revisions in C", 2018-08-28)), the interactive-backend accidentally treated it as a positive revision rather than a negated one. This was missed as there were no tests in the testsuite that tested an interactive rebase with fork-point behavior. Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- builtin/rebase.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'builtin/rebase.c') diff --git a/builtin/rebase.c b/builtin/rebase.c index 1a664137d2..8264a9243f 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -348,8 +348,8 @@ static int do_interactive_rebase(struct rebase_options *opts, unsigned flags) argv_array_pushl(&make_script_args, "", revisions, NULL); if (opts->restrict_revision) - argv_array_push(&make_script_args, - oid_to_hex(&opts->restrict_revision->object.oid)); + argv_array_pushf(&make_script_args, "^%s", + oid_to_hex(&opts->restrict_revision->object.oid)); ret = sequencer_make_script(the_repository, &todo_list.buf, make_script_args.argc, make_script_args.argv, -- cgit v1.2.3