refs: refactor resolve_gitlink_ref()
to accept a repository
In `resolve_gitlink_ref()` we implicitly rely on `the_repository` to look up the submodule ref store. Now that we can look up submodule ref stores for arbitrary repositories we can improve this function to instead accept a repository as parameter for which we want to resolve the gitlink. Do so and adjust callers accordingly. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
965f8991e5
commit
e19488a60a
7
refs.c
7
refs.c
@ -1943,13 +1943,14 @@ int ref_store_create_on_disk(struct ref_store *refs, int flags, struct strbuf *e
|
||||
return refs->be->create_on_disk(refs, flags, err);
|
||||
}
|
||||
|
||||
int resolve_gitlink_ref(const char *submodule, const char *refname,
|
||||
struct object_id *oid)
|
||||
int repo_resolve_gitlink_ref(struct repository *r,
|
||||
const char *submodule, const char *refname,
|
||||
struct object_id *oid)
|
||||
{
|
||||
struct ref_store *refs;
|
||||
int flags;
|
||||
|
||||
refs = repo_get_submodule_ref_store(the_repository, submodule);
|
||||
refs = repo_get_submodule_ref_store(r, submodule);
|
||||
if (!refs)
|
||||
return -1;
|
||||
|
||||
|
Reference in New Issue
Block a user