aboutsummaryrefslogtreecommitdiffstats
path: root/refs.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-05-07 09:11:53 +0200
committerJunio C Hamano <gitster@pobox.com>2024-05-07 10:06:59 -0700
commit2e5c4758b75f7cbae612c89b177aa045fa4f9c68 (patch)
tree4836d2b3c740848d105355f0c6150f32acdcd0de /refs.c
parentcocci: introduce rules to transform "refs" to pass ref store (diff)
downloadgit-2e5c4758b75f7cbae612c89b177aa045fa4f9c68.tar.gz
git-2e5c4758b75f7cbae612c89b177aa045fa4f9c68.zip
cocci: apply rules to rewrite callers of "refs" interfaces
Apply the rules that rewrite callers of "refs" interfaces to explicitly pass `struct ref_store`. The resulting patch has been applied with the `--whitespace=fix` option. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/refs.c b/refs.c
index 00bcc72719..d398731d74 100644
--- a/refs.c
+++ b/refs.c
@@ -487,7 +487,8 @@ static int warn_if_dangling_symref(const char *refname,
if (!(flags & REF_ISSYMREF))
return 0;
- resolves_to = resolve_ref_unsafe(refname, 0, NULL, NULL);
+ resolves_to = refs_resolve_ref_unsafe(get_main_ref_store(the_repository),
+ refname, 0, NULL, NULL);
if (!resolves_to
|| (d->refname
? strcmp(resolves_to, d->refname)
@@ -508,7 +509,8 @@ void warn_dangling_symref(FILE *fp, const char *msg_fmt, const char *refname)
data.refname = refname;
data.refnames = NULL;
data.msg_fmt = msg_fmt;
- for_each_rawref(warn_if_dangling_symref, &data);
+ refs_for_each_rawref(get_main_ref_store(the_repository),
+ warn_if_dangling_symref, &data);
}
void warn_dangling_symrefs(FILE *fp, const char *msg_fmt, const struct string_list *refnames)
@@ -519,7 +521,8 @@ void warn_dangling_symrefs(FILE *fp, const char *msg_fmt, const struct string_li
data.refname = NULL;
data.refnames = refnames;
data.msg_fmt = msg_fmt;
- for_each_rawref(warn_if_dangling_symref, &data);
+ refs_for_each_rawref(get_main_ref_store(the_repository),
+ warn_if_dangling_symref, &data);
}
int refs_for_each_tag_ref(struct ref_store *refs, each_ref_fn fn, void *cb_data)