Re: [PATCH 2/4] refs/reftable: don't write new table when expire is a no-op
On Wed, Nov 18, 2026 at 04:34:15PM +0100, Toon Claes wrote:
Show 20 quoted lines
> Patrick Steinhardt <ps@pks.im> writes:
> > diff --git a/refs/reftable-backend.c b/refs/reftable-backend.c
> > index 4216a18684d..e2027bb9c02 100644
> > --- a/refs/reftable-backend.c
> > +++ b/refs/reftable-backend.c
> > @@ -2696,17 +2697,25 @@ static int reftable_be_reflog_expire(struct ref_store *ref_store,
> > logs[i].value.update.message,
> > policy_cb_data)) {
> > dest->value_type = REFTABLE_LOG_DELETION;
> > + has_changes = true;
> > } else {
> > - if ((flags & EXPIRE_REFLOGS_REWRITE) && last_hash)
> > + if ((flags & EXPIRE_REFLOGS_REWRITE) && last_hash &&
> > + memcmp(dest->value.update.old_hash, last_hash,
> > + ref_store->repo->hash_algo->rawsz)) {
> > memcpy(dest->value.update.old_hash, last_hash, GIT_MAX_RAWSZ);
>
> I cannot help being bothered by using GIT_MAX_RAWSZ here, and
> ref_store->repo->hash_algo->rawsz the line above. Would it make sense to
> be consistent?Fair point, will fix.
Patrick