path: root/builtin
diff options
authorElijah Newren <>2020-02-15 21:36:29 (GMT)
committerJunio C Hamano <>2020-02-16 23:40:42 (GMT)
commit93122c985a3671bd4e15b3dbc6b457c981eb8c23 (patch)
tree5944be3ef00ab57c29f78a2e54e8196c76751b43 /builtin
parent55d2b6d785da8c49d693d989c22f47622783903a (diff)
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 <>
Diffstat (limited to 'builtin')
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 1a66413..8264a92 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,