summaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2015-07-06 17:30:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-07-06 18:07:48 (GMT)
commit0ca560cb975aa081971d0fb1586e0206156fa22f (patch)
treef8abfad257abc666fb4e001c3986aec43bdd88d5 /git.c
parentb979d95027242455b10e6f566b0e96c5f30cc908 (diff)
downloadgit-0ca560cb975aa081971d0fb1586e0206156fa22f.zip
git-0ca560cb975aa081971d0fb1586e0206156fa22f.tar.gz
git-0ca560cb975aa081971d0fb1586e0206156fa22f.tar.bz2
checkout: require worktree unconditionally
In order to allow linked worktree creation via "git checkout --to" from a bare repository, 3473ad0 (checkout: don't require a work tree when checking out into a new one, 2014-11-30) dropped git-checkout's unconditional NEED_WORK_TREE requirement and instead performed worktree setup conditionally based upon presence or absence of the --to option. Now that --to has been retired and git-checkout is no longer responsible for linked worktree creation, the NEED_WORK_TREE requirement can be re-instated. This effectively reverts 3473ad0, except for the tests it added which now check bare repository behavior of "git worktree add" instead. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git.c')
-rw-r--r--git.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/git.c b/git.c
index f227838..21a6398 100644
--- a/git.c
+++ b/git.c
@@ -383,7 +383,7 @@ static struct cmd_struct commands[] = {
{ "check-ignore", cmd_check_ignore, RUN_SETUP | NEED_WORK_TREE },
{ "check-mailmap", cmd_check_mailmap, RUN_SETUP },
{ "check-ref-format", cmd_check_ref_format },
- { "checkout", cmd_checkout, RUN_SETUP },
+ { "checkout", cmd_checkout, RUN_SETUP | NEED_WORK_TREE },
{ "checkout-index", cmd_checkout_index,
RUN_SETUP | NEED_WORK_TREE},
{ "cherry", cmd_cherry, RUN_SETUP },