Re: [PATCH] checkout-index needs a working tree
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Aug 10, 2007, 00:31 UTC
- Message-ID
- <Pine.LNX.4.64.0708100129200.21857@racer.site>
- In-Reply-To
- <20070809223530.GA29680@cassiopeia>
Hi,
On Fri, 10 Aug 2007, Uwe Kleine-K?nig wrote:
Show 30 quoted lines
> Johannes Schindelin wrote:
> >
> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> > ---
> >
> > This fixes "git --work-tree=/some/where/else checkout-index".
> >
> > git.c | 3 ++-
> > 1 files changed, 2 insertions(+), 1 deletions(-)
> >
> > diff --git a/git.c b/git.c
> > index 25b8274..f8c4545 100644
> > --- a/git.c
> > +++ b/git.c
> > @@ -315,7 +315,8 @@ static void handle_internal_command(int argc, const char **argv)
> > { "branch", cmd_branch, RUN_SETUP },
> > { "bundle", cmd_bundle },
> > { "cat-file", cmd_cat_file, RUN_SETUP },
> > - { "checkout-index", cmd_checkout_index, RUN_SETUP },
> > + { "checkout-index", cmd_checkout_index,
> > + RUN_SETUP | NEED_WORK_TREE},
> > { "check-ref-format", cmd_check_ref_format },
> > { "check-attr", cmd_check_attr, RUN_SETUP | NEED_WORK_TREE },
> > { "cherry", cmd_cherry, RUN_SETUP },
> With this patch I'm not able to do
>
> git checkout-index --prefix=/tmp/exportdir -a
>
> to export an entire tree as described in git-checkout-index(1) in a bare
> repo.That is _completely_ expected. If it is a bare repository, you can _only_ override that check by GIT_WORK_TREE or --work-tree.
But I have to wonder: if you want to use git checkout-index, which is a work-tree operation, why did you mark it as bare to begin with?
Ciao, Dscho