refs: pass ref store when detecting dangling symrefs

Both `warn_dangling_symref()` and `warn_dangling_symrefs()` derive the
ref store via `the_repository`. Adapt them to instead take in the ref
store as a parameter. While at it, rename the functions to have a `ref_`
prefix to align them with other functions that take a ref store.

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-17 10:18:53 +02:00
committed by Junio C Hamano
parent 8378c9d27b
commit 330a2ae60b
4 changed files with 28 additions and 25 deletions

View File

@ -1477,7 +1477,8 @@ static int prune_remote(const char *remote, int dry_run)
abbrev_ref(refname, "refs/remotes/"));
}
warn_dangling_symrefs(stdout, dangling_msg, &refs_to_prune);
refs_warn_dangling_symrefs(get_main_ref_store(the_repository),
stdout, dangling_msg, &refs_to_prune);
string_list_clear(&refs_to_prune, 0);
free_remote_ref_states(&states);