Subject: Re: [PATCH] xdiff-interface: stop using the_repository

From: René Scharfe <[email-masked]>
Date: Mon, 9 Feb 2026 20:24:51 +0100

On 2/9/26 6:45 PM, Junio C Hamano wrote:
> René Scharfe <[email-masked]> writes:
> 
>>>> -	ptr->ptr = odb_read_object(the_repository->objects, oid, &type, &size);
>>>> +	ptr->ptr = odb_read_object(odb, oid, &type, &size);
>>>>  	if (!ptr->ptr || type != OBJ_BLOB)
>>>>  		die("unable to read blob object %s", oid_to_hex(oid));
>>>>  	ptr->size = size;
>>
>> My initial version did that.  Then I realized that read_mmblob() is just
>> a thin odb_read_object() wrapper that converts null_oid to
>> empty_blob_oid and dies on non-blobs, though, so requiring a full repo
>> pointer seemed excessive.  And all callers also use other odb_*
>> functions already.
> 
> Absolutely.  Passing the narrowest thing the callee needs is the
> right approach and that is what is done in the version posted.
> 
> Thanks.  I presume that a small and final reroll is expected, if
> only to remove the now unnecessary #include, if not splitting it
> into three parts?

Right, and still keeping it all in one patch, now that it has become
slightly shorter. :)

René