Subject: Re: [PATCH 00/13] refs: improvements and fixes for peeling tags

From: Junio C Hamano <[email-masked]>
Date: Tue, 07 Oct 2025 14:00:24 -0700

Patrick Steinhardt <[email-masked]> writes:

> diff --cc builtin/repack.c
> index 873e21c35d,ad60c4290d..0000000000
> --- a/builtin/repack.c
> +++ b/builtin/repack.c
> diff --git a/repack-midx.c b/repack-midx.c
> index 6f6202c5bc..74bdfa3a6e 100644
> --- a/repack-midx.c
> +++ b/repack-midx.c
> @@ -16,25 +16,23 @@ struct midx_snapshot_ref_data {
>  	int preferred;
>  };
>  
> -static int midx_snapshot_ref_one(const char *refname UNUSED,
> -				 const char *referent UNUSED,
> -				 const struct object_id *oid,
> -				 int flag UNUSED, void *_data)
> +static int midx_snapshot_ref_one(const struct reference *ref, void *_data)
>  {
>  	struct midx_snapshot_ref_data *data = _data;
> +	const struct object_id *maybe_peeled = ref->oid;
>  	struct object_id peeled;
>  
> -	if (!peel_iterated_oid(data->repo, oid, &peeled))
> -		oid = &peeled;
> +	if (!reference_get_peeled_oid(data->repo, ref, &peeled))
> +		maybe_peeled = &peeled;
>  
> -	if (oidset_insert(&data->seen, oid))
> +	if (oidset_insert(&data->seen, maybe_peeled))
>  		return 0; /* already seen */
>  
> -	if (odb_read_object_info(data->repo->objects, oid, NULL) != OBJ_COMMIT)
> +	if (odb_read_object_info(data->repo->objects, maybe_peeled, NULL) != OBJ_COMMIT)
>  		return 0;
>  
>  	fprintf(data->f->fp, "%s%s\n", data->preferred ? "+" : "",
> -		oid_to_hex(oid));
> +		oid_to_hex(maybe_peeled));
>  
>  	return 0;
>  }

This seems to match the manual resolution I just made, except that I
line wrapped overly wide line ;-).  

Queued.