Re: [PATCH v3 2/4] fetch-pack: prepare updated shallow file before fetching the pack

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 7, 2013 at 10:59 PM, Junio C Hamano <gitster@xxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]