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

From: Patrick Steinhardt <[email-masked]>
Date: Mon, 9 Feb 2026 10:48:25 +0100

On Sun, Feb 08, 2026 at 02:47:40PM +0100, René Scharfe wrote:
> diff --git a/xdiff-interface.c b/xdiff-interface.c
> index 1a35556380..cd7493730b 100644
> --- a/xdiff-interface.c
> +++ b/xdiff-interface.c
> @@ -7,6 +6,7 @@
>  #include "config.h"
>  #include "hex.h"
>  #include "odb.h"
> +#include "repository.h"
>  #include "strbuf.h"
>  #include "xdiff-interface.h"
>  #include "xdiff/xtypes.h"

It's a bit surprising that we have to add this include, but I assume
that we use a function that's declared in this file?

> @@ -177,18 +177,19 @@ int read_mmfile(mmfile_t *ptr, const char *filename)
>  	return 0;
>  }
>  
> -void read_mmblob(mmfile_t *ptr, const struct object_id *oid)
> +void read_mmblob(mmfile_t *ptr, struct object_database *odb,
> +		 const struct object_id *oid)
>  {
>  	unsigned long size;
>  	enum object_type type;
>  
> -	if (oideq(oid, null_oid(the_hash_algo))) {
> +	if (is_null_oid(oid)) {
>  		ptr->ptr = xstrdup("");
>  		ptr->size = 0;
>  		return;
>  	}

Arguably the commit coudl've been split up into three:

  1. The change to `is_null_oid()`.

  2. Adding the ODB to the parameter.

  3. Removing the macro and adding the include.

So that each of those could have a bit more explanation. But I guess the
changes are smallish enough so that this borders on okay-ish, so I won't
insist on such a change.

Other than that this patch looks good to me, thanks!

Patrick