]> git.ipfire.org Git - thirdparty/git.git/commit
refs: convert iteration over replace refs to accept ref store
authorPatrick Steinhardt <ps@pks.im>
Fri, 17 May 2024 08:18:49 +0000 (10:18 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 17 May 2024 17:33:38 +0000 (10:33 -0700)
commit8378c9d27bace61d3fb238259604045a8997387b
treea8e4b9f0dbb91c0d4fbb3e8e05c08afd87e38476
parentdc7fb4f72c2e39ffbb98aee55ad7ea4c3f8e12fc
refs: convert iteration over replace refs to accept ref store

The function `for_each_replace_ref()` is a bit of an oddball across the
refs interfaces as it accepts a pointer to the repository instead of a
pointer to the ref store. The only reason for us to accept a repository
is so that we can eventually pass it back to the callback function that
the caller has provided. This is somewhat arbitrary though, as callers
that need the repository can instead make it accessible via the callback
payload.

Refactor the function to instead accept the ref store and adjust callers
accordingly. This allows us to get rid of some of the boilerplate that
we had to carry to pass along the repository and brings us in line with
the other functions that iterate through refs.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/replace.c
refs.c
refs.h
refs/iterator.c
refs/refs-internal.h
replace-object.c