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>
This commit is contained in:
Patrick Steinhardt
2024-05-07 09:11:53 +02:00
committed by Junio C Hamano
parent b198ee0b3d
commit 2e5c4758b7
75 changed files with 711 additions and 436 deletions

5
help.c
View File

@ -800,7 +800,7 @@ static int append_similar_ref(const char *refname,
if (starts_with(refname, "refs/remotes/") &&
!strcmp(branch, cb->base_ref))
string_list_append_nodup(cb->similar_refs,
shorten_unambiguous_ref(refname, 1));
refs_shorten_unambiguous_ref(get_main_ref_store(the_repository), refname, 1));
return 0;
}
@ -811,7 +811,8 @@ static struct string_list guess_refs(const char *ref)
ref_cb.base_ref = ref;
ref_cb.similar_refs = &similar_refs;
for_each_ref(append_similar_ref, &ref_cb);
refs_for_each_ref(get_main_ref_store(the_repository),
append_similar_ref, &ref_cb);
return similar_refs;
}