On Thu, Jul 2, 2015 at 2:45 PM, Eric Sunshine <sunshine@xxxxxxxxxxxxxx> wrote: > There's another instance: 3473ad0 (checkout: don't require a work tree > when checking out into a new one, 2014-11-30) added this: > > if (!new_worktree) > setup_work_tree(); > > which the "worktree add" patch changed to: > > setup_work_tree(); > > which doesn't hurt (since setup_work_tree() protects itself against > multiple invocations) but isn't semantically clean. If I understand > correctly, I think a better approach would be to move the > setup_work_tree() call to worktree.c just before it invokes > git-checkout, and revert 3473ad0 entirely (including this bit): > > - { "checkout", cmd_checkout, RUN_SETUP | NEED_WORK_TREE }, > +{ "checkout", cmd_checkout, RUN_SETUP }, > > so that git-checkout once again requires a worktree. I mis-stated that a bit. The bit about "multiple invocations" isn't relevant. The point is that I think that 3473ad0 can simply be reverted as long as worktree.c calls setup_work_tree() before invoking git-checkout. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html