Skip to content

Commit 80dfc92

Browse files
dschogitster
authored andcommitted
git: mark cmd_rebase as requiring a worktree
We skipped marking the "rebase" built-in as requiring a .git/ directory and a worktree only to allow to spawn the scripted version of `git rebase`. Now that we no longer have that escape hatch, we can change that to the canonical form. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cbea646 commit 80dfc92

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

builtin/rebase.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,10 +1486,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
14861486
usage_with_options(builtin_rebase_usage,
14871487
builtin_rebase_options);
14881488

1489-
prefix = setup_git_directory();
1490-
trace_repo_setup(prefix);
1491-
setup_work_tree();
1492-
14931489
options.allow_empty_message = 1;
14941490
git_config(rebase_config, &options);
14951491

git.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -549,12 +549,7 @@ static struct cmd_struct commands[] = {
549549
{ "push", cmd_push, RUN_SETUP },
550550
{ "range-diff", cmd_range_diff, RUN_SETUP | USE_PAGER },
551551
{ "read-tree", cmd_read_tree, RUN_SETUP | SUPPORT_SUPER_PREFIX},
552-
/*
553-
* NEEDSWORK: Until the rebase is independent and needs no redirection
554-
* to rebase shell script this is kept as is, then should be changed to
555-
* RUN_SETUP | NEED_WORK_TREE
556-
*/
557-
{ "rebase", cmd_rebase },
552+
{ "rebase", cmd_rebase, RUN_SETUP | NEED_WORK_TREE },
558553
{ "rebase--interactive", cmd_rebase__interactive, RUN_SETUP | NEED_WORK_TREE },
559554
{ "receive-pack", cmd_receive_pack },
560555
{ "reflog", cmd_reflog, RUN_SETUP },

0 commit comments

Comments
 (0)