summaryrefslogtreecommitdiffstats
path: root/attr.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-05-17 10:18:39 +0200
committerJunio C Hamano <gitster@pobox.com>2024-05-17 19:33:38 +0200
commite19488a60aab022ca4c8d32d6629c04ce94f2779 (patch)
treec1d38f4475913be4d2033a2cd902d2f53a61cc35 /attr.c
parentrefs: pass repo when retrieving submodule ref store (diff)
downloadgit-e19488a60aab022ca4c8d32d6629c04ce94f2779.tar.xz
git-e19488a60aab022ca4c8d32d6629c04ce94f2779.zip
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>
Diffstat (limited to 'attr.c')
-rw-r--r--attr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/attr.c b/attr.c
index 33473bdce0..6c6eb05333 100644
--- a/attr.c
+++ b/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;
}
}