Skip to content

Commit 38dac33

Browse files
committed
Merge branch 'js/rebase-cleanup'
A few leftover cleanup to "git rebase" in C. * js/rebase-cleanup: git: mark cmd_rebase as requiring a worktree rebase: fix white-space
2 parents c3d4c20 + 80dfc92 commit 38dac33

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

builtin/rebase.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -1492,10 +1492,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
14921492
usage_with_options(builtin_rebase_usage,
14931493
builtin_rebase_options);
14941494

1495-
prefix = setup_git_directory();
1496-
trace_repo_setup(prefix);
1497-
setup_work_tree();
1498-
14991495
options.allow_empty_message = 1;
15001496
git_config(rebase_config, &options);
15011497

@@ -2126,7 +2122,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
21262122
strbuf_addf(&msg, "%s: checkout %s",
21272123
getenv(GIT_REFLOG_ACTION_ENVIRONMENT), options.onto_name);
21282124
if (reset_head(&options.onto->object.oid, "checkout", NULL,
2129-
RESET_HEAD_DETACH | RESET_ORIG_HEAD |
2125+
RESET_HEAD_DETACH | RESET_ORIG_HEAD |
21302126
RESET_HEAD_RUN_POST_CHECKOUT_HOOK,
21312127
NULL, msg.buf))
21322128
die(_("Could not detach HEAD"));

git.c

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

0 commit comments

Comments
 (0)