Re: [PATCH 5/6] path-walk: visit tags and cached objects
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Nov 4, 2024, 15:56 UTC
- Message-ID
- <1b81a6a3-ba51-4d2c-8529-1063d045bad5@gmail.com>
- In-Reply-To
- <CAOLa=ZR1BjKzujxpA2icAfJHin-krqwkxTf5VPeGg14AVr-TcQ@mail.gmail.com>
On 11/1/24 10:25 AM, karthik nayak wrote:
Show 14 quoted lines
> "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes: > >> From: Derrick Stolee <stolee@gmail.com> >> >> The rev_info that is specified for a path-walk traversal may specify >> visiting tag refs (both lightweight and annotated) and also may specify >> indexed objects (blobs and trees). Update the path-walk API to walk >> these objects as well. >> >> When walking tags, we need to peel the annotated objects until reaching >> a non-tag object. If we reach a commit, then we can add it to the >> pending objects to make sure we visit in the commit walk portion. If we > > Nit: s/in/it in/
thanks!
Show 16 quoted lines
>> + case OBJ_BLOB:
>> + if (!info->blobs)
>> + continue;
>> + if (pending->path) {
>> + struct type_and_oid_list *list;
>> + char *path = pending->path;
>> + if (!(list = strmap_get(&ctx->paths_to_lists, path))) {
>> + CALLOC_ARRAY(list, 1);
>> + list->type = OBJ_BLOB;
>> + strmap_put(&ctx->paths_to_lists, path, list);
>> + }
>> + oid_array_append(&list->oids, &obj->oid);
>> + } else {
>> + /* assume a root tree, such as a lightweight tag. */
>
> Shouldn't this comment be for tagged blobs?Yes. This is a copy-paste error.
Thanks for the careful reading. -Stolee