git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Derrick Stolee <stolee@gmail.com>
Date
Dec 6, 2021, 13:59 UTC
Message-ID
<166c107e-1884-ca53-fa46-12b39e6af13f@gmail.com>
In-Reply-To
<CABPp-BEs8_F7SKsxDMd8p03oMn9M3H47=hrPP=AzxsacUkGg_A@mail.gmail.com>
On 12/4/2021 12:42 AM, Elijah Newren wrote:
> On Fri, Dec 3, 2021 at 6:55 PM Derrick Stolee via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
Show 21 quoted lines
>> @@ -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

Previous: Elijah NewrenNext: Derrick Stolee via GitGitGadget
Message 4 of 9 in “Sparse Index: fix a checkout bug with deep sparse-checkout patterns”
  1. 0/2 Sparse Index: fix a checkout bug with deep sparse-checkout patternsDerrick Stolee via GitGitGadget, Dec 4, 2021
  2. 2/2 unpack-trees: use traverse_path instead of nameDerrick Stolee via GitGitGadget, Dec 4, 2021
  3. Elijah NewrenDec 4, 2021
  4. Derrick StoleeDec 6, 2021
  5. 1/2 t1092: add deeper changes during a checkoutDerrick Stolee via GitGitGadget, Dec 4, 2021
  6. Elijah NewrenDec 4, 2021
  7. 0/2 Sparse Index: fix a checkout bug with deep sparse-checkout patternsDerrick Stolee via GitGitGadget, Dec 6, 2021
  8. 1/2 t1092: add deeper changes during a checkoutDerrick Stolee via GitGitGadget, Dec 6, 2021
  9. 2/2 unpack-trees: use traverse_path instead of nameDerrick Stolee via GitGitGadget, Dec 6, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.