mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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
3
attr.c
3
attr.c
@@ -1288,7 +1288,8 @@ static const char *builtin_object_mode_attr(struct index_state *istate, const ch
|
||||
if (pos >= 0) {
|
||||
if (S_ISGITLINK(istate->cache[pos]->ce_mode))
|
||||
mode = istate->cache[pos]->ce_mode;
|
||||
} else if (resolve_gitlink_ref(path, "HEAD", &oid) == 0) {
|
||||
} else if (repo_resolve_gitlink_ref(the_repository, path,
|
||||
"HEAD", &oid) == 0) {
|
||||
mode = S_IFGITLINK;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user