From e19488a60aab022ca4c8d32d6629c04ce94f2779 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Fri, 17 May 2024 10:18:39 +0200 Subject: 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 Signed-off-by: Junio C Hamano --- combine-diff.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'combine-diff.c') diff --git a/combine-diff.c b/combine-diff.c index d6d6fa1689..4960d904ac 100644 --- a/combine-diff.c +++ b/combine-diff.c @@ -1066,7 +1066,8 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent, elem->mode = canon_mode(st.st_mode); } else if (S_ISDIR(st.st_mode)) { struct object_id oid; - if (resolve_gitlink_ref(elem->path, "HEAD", &oid) < 0) + if (repo_resolve_gitlink_ref(the_repository, elem->path, + "HEAD", &oid) < 0) result = grab_blob(opt->repo, &elem->oid, elem->mode, &result_size, NULL, NULL); -- cgit v1.3