From cbea64615301e7dea0cd756cf0245653ecbf6edc Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 24 Jul 2019 14:14:59 -0700 Subject: [PATCH 1/2] rebase: fix white-space This trailing space was inadvertently introduced in 9fbcc3d203 (Merge branch 'js/rebase-orig-head-fix', 2019-03-20). Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- builtin/rebase.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/rebase.c b/builtin/rebase.c index db6ca9bd7d..2f9041fce2 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -2109,7 +2109,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) strbuf_addf(&msg, "%s: checkout %s", getenv(GIT_REFLOG_ACTION_ENVIRONMENT), options.onto_name); if (reset_head(&options.onto->object.oid, "checkout", NULL, - RESET_HEAD_DETACH | RESET_ORIG_HEAD | + RESET_HEAD_DETACH | RESET_ORIG_HEAD | RESET_HEAD_RUN_POST_CHECKOUT_HOOK, NULL, msg.buf)) die(_("Could not detach HEAD")); From 80dfc9242ebaba357ffedececd88641a1a752411 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 24 Jul 2019 14:15:00 -0700 Subject: [PATCH 2/2] 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 Signed-off-by: Junio C Hamano --- builtin/rebase.c | 4 ---- git.c | 7 +------ 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/builtin/rebase.c b/builtin/rebase.c index 2f9041fce2..21681a551b 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -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 1bf9c94550..1461e819c3 100644 --- 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 },