From: Junio C Hamano Date: Mon, 26 Aug 2013 06:09:30 GMT Subject: Re: [PATCH] fetch-pack: do not remove .git/shallow file when --depth is not specified Message-ID: In-Reply-To: <1377483446-24834-1-git-send-email-pclouds@gmail.com> Nguyễn Thái Ngọc Duy writes: > > 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. Thanks.