Re: [PATCH 2/2] unpack-trees: use traverse_path instead of name

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

 



On 12/4/2021 12:42 AM, Elijah Newren wrote:
> On Fri, Dec 3, 2021 at 6:55 PM Derrick Stolee via GitGitGadget
> <gitgitgadget@xxxxxxxxx> wrote:

>> @@ -1243,11 +1243,11 @@ static int sparse_dir_matches_path(const struct cache_entry *ce,
>>         assert(S_ISSPARSEDIR(ce->ce_mode));
>>         assert(ce->name[ce->ce_namelen - 1] == '/');
>>
>> -       if (info->namelen)
>> -               return ce->ce_namelen == info->namelen + p->pathlen + 2 &&
>> -                      ce->name[info->namelen] == '/' &&
>> -                      !strncmp(ce->name, info->name, info->namelen) &&
>> -                      !strncmp(ce->name + info->namelen + 1, p->path, p->pathlen);
>> +       if (info->pathlen)
>> +               return ce->ce_namelen == info->pathlen + p->pathlen + 1 &&
>> +                      ce->name[info->pathlen - 1] == '/' &&
>> +                      !strncmp(ce->name, info->traverse_path, info->pathlen) &&
>> +                      !strncmp(ce->name + info->pathlen, p->path, p->pathlen);
>>         return ce->ce_namelen == p->pathlen + 1 &&
>>                !strncmp(ce->name, p->path, p->pathlen);
>>  }
>> --
> 
> The comment at the beginning of this function (not shown in this
> patch) is now stale and misleading; it should be corrected too.
 
Will do! Thanks for catching that.

Thanks,
-Stolee



[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]

  Powered by Linux