refs: replace `refs_for_each_rawref_in()`

Replace calls to `refs_for_each_rawref_in()` with the newly introduced `refs_for_each_ref_ext()` function. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Feb 23, 2026 at 12:59 UTC 5ef6d593f18ac6b1e7540eed45f5d795d5a82faa
3 files changed +6 -16
builtin/remote.c
+6 -2
@@ -912,6 +912,9 @@ static int mv(int argc, const char **argv, const char *prefix,
912 old_remote_context.buf);
913
914 if (refspecs_need_update) {
915 + struct refs_for_each_ref_options opts = {
916 + .flags = REFS_FOR_EACH_INCLUDE_BROKEN,
917 + };
918 rename.transaction = ref_store_transaction_begin(get_main_ref_store(the_repository),
919 0, &err);
920 if (!rename.transaction)
@@ -923,9 +926,10 @@ static int mv(int argc, const char **argv, const char *prefix,
926
927 strbuf_reset(&buf);
928 strbuf_addf(&buf, "refs/remotes/%s/", rename.old_name);
929 + opts.prefix = buf.buf;
930
927 - result = refs_for_each_rawref_in(get_main_ref_store(the_repository), buf.buf,
928 - rename_one_ref, &rename);
931 + result = refs_for_each_ref_ext(get_main_ref_store(the_repository),
932 + rename_one_ref, &rename, &opts);
933 if (result < 0)
934 die(_("queueing remote ref renames failed: %s"), rename.err->buf);
935
refs.c
-10
@@ -1982,16 +1982,6 @@ int refs_for_each_namespaced_ref(struct ref_store *refs,
1982 return refs_for_each_ref_ext(refs, cb, cb_data, &opts);
1983 }
1984
1985 -int refs_for_each_rawref_in(struct ref_store *refs, const char *prefix,
1986 - refs_for_each_cb cb, void *cb_data)
1987 -{
1988 - struct refs_for_each_ref_options opts = {
1989 - .prefix = prefix,
1990 - .flags = REFS_FOR_EACH_INCLUDE_BROKEN,
1991 - };
1992 - return refs_for_each_ref_ext(refs, cb, cb_data, &opts);
1993 -}
1994 -
1985 static int qsort_strcmp(const void *va, const void *vb)
1986 {
1987 const char *a = *(const char **)va;
refs.h
-4
@@ -542,10 +542,6 @@ int refs_for_each_namespaced_ref(struct ref_store *refs,
542 const char **exclude_patterns,
543 refs_for_each_cb fn, void *cb_data);
544
545 -/* can be used to learn about broken ref and symref */
546 -int refs_for_each_rawref_in(struct ref_store *refs, const char *prefix,
547 - refs_for_each_cb fn, void *cb_data);
548 -
545 /*
546 * Normalizes partial refs to their fully qualified form.
547 * Will prepend <prefix> to the <pattern> if it doesn't start with 'refs/'.