From 2e5c4758b75f7cbae612c89b177aa045fa4f9c68 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Tue, 7 May 2024 09:11:53 +0200 Subject: 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 Signed-off-by: Junio C Hamano --- submodule.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'submodule.c') diff --git a/submodule.c b/submodule.c index ce2d032521..bdd75faa44 100644 --- a/submodule.c +++ b/submodule.c @@ -1233,7 +1233,8 @@ int push_unpushed_submodules(struct repository *r, char *head; struct object_id head_oid; - head = resolve_refdup("HEAD", 0, &head_oid, NULL); + head = refs_resolve_refdup(get_main_ref_store(the_repository), + "HEAD", 0, &head_oid, NULL); if (!head) die(_("Failed to resolve HEAD as a valid ref.")); @@ -1271,7 +1272,8 @@ static int append_oid_to_array(const char *ref UNUSED, void check_for_new_submodule_commits(struct object_id *oid) { if (!initialized_fetch_ref_tips) { - for_each_ref(append_oid_to_array, &ref_tips_before_fetch); + refs_for_each_ref(get_main_ref_store(the_repository), + append_oid_to_array, &ref_tips_before_fetch); initialized_fetch_ref_tips = 1; } -- cgit v1.2.3