git: mark cmd_rebase as requiring a worktree
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 24 Jul 2019 21:15:00 +0000 (14:15 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 25 Jul 2019 15:58:13 +0000 (08:58 -0700)
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 <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rebase.c
git.c
index 2f9041fce2e4a7bd9ca52aba5fcc7e0e6a7c7d5f..21681a551b1983cf9229e9f793bbbd53414451bb 100644 (file)
@@ -1486,10 +1486,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
                usage_with_options(builtin_rebase_usage,
                                   builtin_rebase_options);
 
-       prefix = setup_git_directory();
-       trace_repo_setup(prefix);
-       setup_work_tree();
-
        options.allow_empty_message = 1;
        git_config(rebase_config, &options);
 
diff --git a/git.c b/git.c
index 1bf9c94550d9c232de2f89ef0f2b5a661e43cd79..1461e819c32b43160b50bbcf2eb84ea3ecb983df 100644 (file)
--- a/git.c
+++ b/git.c
@@ -549,12 +549,7 @@ static struct cmd_struct commands[] = {
        { "push", cmd_push, RUN_SETUP },
        { "range-diff", cmd_range_diff, RUN_SETUP | USE_PAGER },
        { "read-tree", cmd_read_tree, RUN_SETUP | SUPPORT_SUPER_PREFIX},
-       /*
-        * NEEDSWORK: Until the rebase is independent and needs no redirection
-        * to rebase shell script this is kept as is, then should be changed to
-        * RUN_SETUP | NEED_WORK_TREE
-        */
-       { "rebase", cmd_rebase },
+       { "rebase", cmd_rebase, RUN_SETUP | NEED_WORK_TREE },
        { "rebase--interactive", cmd_rebase__interactive, RUN_SETUP | NEED_WORK_TREE },
        { "receive-pack", cmd_receive_pack },
        { "reflog", cmd_reflog, RUN_SETUP },