Subject: Re: [PATCH v3 4/9] refs/reftable: read references via `struct reftable_backend`

From: Junio C Hamano <[email-masked]>
Date: Tue, 26 Nov 2024 09:48:49 +0900

Patrick Steinhardt <[email-masked]> writes:

> Refactor `read_ref_without_reload()` to accept a `struct reftable_stack`
> as input instead of accepting a `struct reftable_stack`.

Hmph...  am I supposed to be puzzled that the patch replaces A with
A?

All callers of read_ref_without_reload() now call
reftable_backend_read_ref().  

The former took <reftable_ref_store, reftable_stack> while the
latter take <reftable_backend>.  They both take <refname, oid,
referent, type>, of course, because the former is replaced by the
latter.

OK, so we introduce a new function, and instead of passing ref-store
and stack, the new function only takes reftable-backend (which has a
stack contained in it).

The old function used ref-store only to find out the hash algorithm
via its base repository.  Since the hash algorithm can be found from
the stack that is in the backend, the new function does not take a
ref-store.  FWIW, the old function did not have to take one either,
but since we are getting rid of the old function altogether, that is
fine ;-)

> This allows us
> to implement an additional caching layer when reading refs where we can
> reuse reftable iterators.

OK.