summaryrefslogtreecommitdiff
path: root/builtin/rebase.c
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2020-02-15 21:36:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-02-16 23:40:42 (GMT)
commit93122c985a3671bd4e15b3dbc6b457c981eb8c23 (patch)
tree5944be3ef00ab57c29f78a2e54e8196c76751b43 /builtin/rebase.c
parent55d2b6d785da8c49d693d989c22f47622783903a (diff)
downloadgit-93122c985a3671bd4e15b3dbc6b457c981eb8c23.zip
git-93122c985a3671bd4e15b3dbc6b457c981eb8c23.tar.gz
git-93122c985a3671bd4e15b3dbc6b457c981eb8c23.tar.bz2
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 <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/rebase.c')
-rw-r--r--builtin/rebase.c4
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,