Re: [PATCH 1/9] "git read-tree -m" and the like require worktree
On Thu, Feb 28, 2008 at 7:48 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 25 quoted lines
>
> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
>
> > Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> > ---
> > builtin-read-tree.c | 3 +++
> > 1 files changed, 3 insertions(+), 0 deletions(-)
> >
> > diff --git a/builtin-read-tree.c b/builtin-read-tree.c
> > index e78cf69..95318e3 100644
> > --- a/builtin-read-tree.c
> > +++ b/builtin-read-tree.c
> > @@ -219,6 +219,9 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
> > if ((opts.dir && !opts.update))
> > die("--exclude-per-directory is meaningless unless -u");
> >
> > + if (opts.merge)
> > + setup_work_tree();
> > +
> > if (opts.prefix) {
> > int pfxlen = strlen(opts.prefix);
> > int pos;
>
> How would this interact with "read-tree -m -i"?
>It setups worktree anyway. Bad. The following would be better
+ if (opts.merge && !opts.index_only)
+ setup_work_tree();
+
--
Duy