From: Duy Nguyen Date: Sun, 26 May 2013 01:01:33 GMT Subject: Re: [PATCH v3 2/4] fetch-pack: prepare updated shallow file before fetching the pack Message-ID: In-Reply-To: <7va9o6lr0h.fsf@alter.siamese.dyndns.org> On Tue, May 7, 2013 at 10:59 PM, Junio C Hamano wrote: >> if (args->depth > 0) { >> + struct stat st; >> + if (!fstat(shallow_lock.fd, &st) && >> + st.st_size == 0) { >> + unlink_or_warn(git_path("shallow")); > > Are we unlinking the right file here? Yes we are. when st.st_size is 0, the new shallow file is empty (i.e. --unshallow), so we want to remove the old file. I should check "!*alternate_shallow_file" here instead of based on st.st_size. -- Duy