Re: [PATCH v3 5/7] path-walk: visit tags and cached objects
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Dec 18, 2024, 14:23 UTC
- Message-ID
- <b1ae2658-d576-433c-9180-8adb57479022@gmail.com>
- In-Reply-To
- <Z1whdAJ4RgQlLNl_@pks.im>
On 12/13/24 6:58 AM, Patrick Steinhardt wrote:
> On Fri, Dec 06, 2024 at 07:45:56PM +0000, Derrick Stolee via GitGitGadget wrote: >> @@ -194,6 +201,134 @@ static void clear_strmap(struct strmap *map)
Show 8 quoted lines
>> + /* Navigate annotated tag object chains. */
>> + while (obj->type == OBJ_TAG) {
>> + struct tag *tag = lookup_tag(info->revs->repo, &obj->oid);
>> + if (!tag)
>> + break;
>
> Same here as previous comments, is this an error that we should rather
> report?Can do.
Show 28 quoted lines
> [snip]
>> + if (tagged_blobs) {
>> + if (tagged_blobs->oids.nr) {
>> + const char *tagged_blob_path = "/tagged-blobs";
>> + tagged_blobs->type = OBJ_BLOB;
>> + push_to_stack(ctx, tagged_blob_path);
>> + strmap_put(&ctx->paths_to_lists, tagged_blob_path, tagged_blobs);
>> + } else {
>> + oid_array_clear(&tagged_blobs->oids);
>> + free(tagged_blobs);
>> + }
>> + }
>> + if (tags) {
>> + if (tags->oids.nr) {
>> + const char *tag_path = "/tags";
>> + tags->type = OBJ_TAG;
>> + push_to_stack(ctx, tag_path);
>> + strmap_put(&ctx->paths_to_lists, tag_path, tags);
>> + } else {
>> + oid_array_clear(&tags->oids);
>> + free(tags);
>> + }
>> + }
>> +}
>
> So this is kind of curious. Does that mean that a file named
> "tagged-blobs" would be thrown into the same bag as a tagged blob? Or
> are these special due to the leading "/"?Indeed, the leading "/" differentiates these categories from other paths that are stored in the process.
Thanks, -Stolee