Re: [PATCH] fetch-pack: do not remove .git/shallow file when --depth is not specified
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
Show 15 quoted lines
> > The two possible fixes which I see are:
> >
> > 1) Replace back if (alternate_shallow_file) condition in fetch pack with
> > if (args->depth > 0)
> >
> > 2) alternate_shallow_file should be copy of shallow_lock.filename not a
> > reference to it
>
> 3) Move alternate_shallow_file to struct fetch_pack_args, which will
> always be zero'd by memset
>
> I think #1 is better. It's the original condition before 6035d6a
> replaces it with "if (alternate_shallow_file)". Apparently I did not
> see that fetch_pack() could be called twice. #3 is also an option,
> but we still need static "shallow_lock" anyway, so I disregarded it.