aboutsummaryrefslogtreecommitdiff
path: root/diffcore-rename.c
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2026-02-21 23:59:48 +0000
committerJunio C Hamano <gitster@pobox.com>2026-02-21 18:34:06 -0800
commit84325f0730801b7638f1152ea3553530452d5c3b (patch)
tree340e4eeff639f6fca397fd7a00ce84e8f5c505e2 /diffcore-rename.c
parent73fd77805fc6406f31c36212846d9e2541d19321 (diff)
downloadgit-84325f0730801b7638f1152ea3553530452d5c3b.tar.xz
merge,diff: remove the_repository check before prefetching blobs
Prefetching of blobs from promisor remotes was added to diff in 7fbbcb21b162 (diff: batch fetching of missing blobs, 2019-04-05). In that commit, https://lore.kernel.org/git/20190405170934.20441-1-jonathantanmy@google.com/ was squashed into https://lore.kernel.org/git/44de02e584f449481e6fb00cf35d74adf0192e9d.1553895166.git.jonathantanmy@google.com/ without the extra explanation about the squashed changes being added to the commit message; in particular, this explanation from that first link is absent: > Also, prefetch only if the repository being diffed is the_repository > (because we do not support lazy fetching for any other repository > anyway). Then, later, this checking was spread from diff.c to diffcore-rename.c and diffcore-break.c by 95acf11a3dc3 (diff: restrict when prefetching occurs, 2020-04-07) and then further split in d331dd3b0c82 (diffcore-rename: allow different missing_object_cb functions, 2021-06-22). I also copied the logic from prefetching blobs from diff.c to merge-ort.c in 2bff554b23e8 (merge-ort: add prefetching for content merges, 2021-06-22). The reason for all these checks was noted above -- we only supported lazy fetching for the_repository. However, that changed with ef830cc43412 (promisor-remote: teach lazy-fetch in any repo, 2021-06-17), so these checks are now unnecessary. Remove them. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diffcore-rename.c')
-rw-r--r--diffcore-rename.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/diffcore-rename.c b/diffcore-rename.c
index d9476db35a..c797d8ed2f 100644
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -987,7 +987,7 @@ static int find_basename_matches(struct diff_options *options,
strintmap_set(&dests, base, i);
}
- if (options->repo == the_repository && repo_has_promisor_remote(the_repository)) {
+ if (repo_has_promisor_remote(options->repo)) {
dpf_options.missing_object_cb = basename_prefetch;
dpf_options.missing_object_data = &prefetch_options;
}
@@ -1574,7 +1574,7 @@ void diffcore_rename_extended(struct diff_options *options,
/* Finish setting up dpf_options */
prefetch_options.skip_unmodified = skip_unmodified;
- if (options->repo == the_repository && repo_has_promisor_remote(the_repository)) {
+ if (repo_has_promisor_remote(options->repo)) {
dpf_options.missing_object_cb = inexact_prefetch;
dpf_options.missing_object_data = &prefetch_options;
}