summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-02-21 12:37:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2024-02-21 17:58:06 (GMT)
commit31f898397bb2f44692b8bcc4fd64fffaf3b59c48 (patch)
treeb6d732741f5215ef054185159df36df22190a4de /revision.c
parent5e01d838412d6679c40c929bbb2591669ae393d4 (diff)
downloadgit-31f898397bb2f44692b8bcc4fd64fffaf3b59c48.zip
git-31f898397bb2f44692b8bcc4fd64fffaf3b59c48.tar.gz
git-31f898397bb2f44692b8bcc4fd64fffaf3b59c48.tar.bz2
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>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/revision.c b/revision.c
index 2424c9b..ac45c6d 100644
--- a/revision.c
+++ b/revision.c
@@ -1686,9 +1686,7 @@ static int handle_one_reflog_ent(struct object_id *ooid, struct object_id *noid,
return 0;
}
-static int handle_one_reflog(const char *refname_in_wt,
- const struct object_id *oid UNUSED,
- int flag UNUSED, void *cb_data)
+static int handle_one_reflog(const char *refname_in_wt, void *cb_data)
{
struct all_refs_cb *cb = cb_data;
struct strbuf refname = STRBUF_INIT;