From: Toon Claes Date: Mon, 30 Mar 2026 17:55:32 GMT Subject: Re: [PATCH v2 05/14] object-name: move logic to iterate through packed prefixed objects Message-ID: <878qb9mcbv.fsf@toon--20250203-5JQV3.mail-host-address-is-not-set> In-Reply-To: <20260320-b4-pks-odb-source-abbrev-v2-5-fe65dcd8c735@pks.im> Patrick Steinhardt writes: > +static int for_each_prefixed_object_in_pack( > + struct packfile_store *store, > + struct packed_git *p, > + const struct odb_for_each_object_options *opts, > + struct packfile_store_for_each_object_wrapper_data *data) > +{ > + uint32_t num, i, first = 0; > + int len = opts->prefix_hex_len > p->repo->hash_algo->hexsz ? > + p->repo->hash_algo->hexsz : opts->prefix_hex_len; > + int ret; > + > + num = p->num_objects; > + bsearch_pack(opts->prefix, p, &first); > + > + /* > + * At this point, "first" is the location of the lowest object > + * with an object name that could match "bin_pfx". See if we have "bin_pfx" isn't used no more, should be "opts->prefix". -- Cheers, Toon