refs: drop unused params from the reflog iterator callback
commit31f898397bb2f44692b8bcc4fd64fffaf3b59c48
authorPatrick Steinhardt <ps@pks.im>
Wed, 21 Feb 2024 12:37:39 +0000 (21 13:37 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 21 Feb 2024 17:58:06 +0000 (21 09:58 -0800)
treeb6d732741f5215ef054185159df36df22190a4de
parent5e01d838412d6679c40c929bbb2591669ae393d4
refs: drop unused params from the reflog iterator callback

The ref and reflog iterators share much of the same underlying code to
iterate over the corresponding entries. This results in some weird code
because the reflog iterator also exposes an object ID as well as a flag
to the callback function. Neither of these fields do refer to the reflog
though -- they refer to the corresponding ref with the same name. This
is quite misleading. In practice at least the object ID cannot really be
implemented in any other way as a reflog does not have a specific object
ID in the first place. This is further stressed by the fact that none of
the callbacks except for our test helper make use of these fields.

Split up the infrastucture so that ref and reflog iterators use separate
callback signatures. This allows us to drop the nonsensical fields from
the reflog iterator.

Note that internally, the backends still use the same shared infra to
iterate over both types. As the backends should never end up being
called directly anyway, this is not much of a problem and thus kept
as-is for simplicity's sake.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fsck.c
builtin/reflog.c
refs.c
refs.h
refs/files-backend.c
refs/reftable-backend.c
revision.c
t/helper/test-ref-store.c
t/t0600-reffiles-backend.sh
t/t1405-main-ref-store.sh
t/t1406-submodule-ref-store.sh