From: Kristoffer Haugsbakk Date: Wed, 08 Oct 2025 11:04:43 GMT Subject: Re: [PATCH 10/13] object: add flag to `peel_object()` to verify object type Message-ID: In-Reply-To: <20251007-b4-pks-ref-filter-skip-parsing-objects-v1-10-916cc7c6886b@pks.im> On Tue, Oct 7, 2025, at 12:58, Patrick Steinhardt wrote: > When peeling a tag to a non-tag object we repeatedly call > `parse_object()` on the tagged object until we find the first object > that isn't a tag. While this feels sensible at first, there is a big > catch here: `parse_object()` doesn't actually verify the type of the > tagged object. > > The relevant code path here eventually ends up in `parse_tag_buffer()`. > Here, we parset he various fields of the tag, including the "type". Once s/parset he/parse the/ > we've figured out the type and the tagged object ID, we call one of the > `lookup_${type}()` functions for whatever type we have found. There is > two possible outcomes in the successful case: > >[snip]