Re: [PATCH 6/7] bulk-checkin: introduce `index_tree_bulk_checkin_incore()`
- From
- Eric Biederman <ebiederm@gmail.com>
- Date
- Oct 7, 2023, 03:07 UTC
- Message-ID
- <E81727B0-A523-4A45-A606-61442357291D@gmail.com>
- In-Reply-To
- <cb0f79cabb7921ab7e334ad8a467ae84853bbd39.1696629697.git.me@ttaylorr.com>
On October 6, 2023 5:02:04 PM CDT, Taylor Blau <me@ttaylorr.com> wrote:
Show 20 quoted lines
>
>Within `deflate_tree_to_pack_incore()`, the changes should be limited
>to something like:
>
> if (the_repository->compat_hash_algo) {
> struct strbuf converted = STRBUF_INIT;
> if (convert_object_file(&compat_obj,
> the_repository->hash_algo,
> the_repository->compat_hash_algo, ...) < 0)
> die(...);
>
> format_object_header_hash(the_repository->compat_hash_algo,
> OBJ_TREE, size);
>
> strbuf_release(&converted);
> }
>
>, assuming related changes throughout the rest of the bulk-checkin
>machinery necessary to update the hash of the converted object, which
>are likewise minimal in size.So this is close. Just in case someone wants to go down this path I want to point out that the converted object need to have the compat hash computed over it.
Which means that the strbuf_release in your example comes a bit early.
Eric