summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-08-02 21:06:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-08-02 21:06:42 (GMT)
commit8230107f336b29d25111c517639b8cd5717c8416 (patch)
treeb24d756b13a4877290c6369d9833d8e6e8f28120 /cache.h
parente9fe413fc29efac6d223cf1bd0cad10231e37df3 (diff)
parentd3da223f2214ebc1527ccf66428aa975de916682 (diff)
downloadgit-8230107f336b29d25111c517639b8cd5717c8416.zip
git-8230107f336b29d25111c517639b8cd5717c8416.tar.gz
git-8230107f336b29d25111c517639b8cd5717c8416.tar.bz2
Merge branch 'jt/bulk-prefetch'
"git read-tree" had a codepath where blobs are fetched one-by-one from the promisor remote, which has been corrected to fetch in bulk. * jt/bulk-prefetch: cache-tree: prefetch in partial clone read-tree unpack-trees: refactor prefetching code
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index f9aed2d..bd4869b 100644
--- a/cache.h
+++ b/cache.h
@@ -410,6 +410,15 @@ struct cache_entry *dup_cache_entry(const struct cache_entry *ce, struct index_s
*/
void validate_cache_entries(const struct index_state *istate);
+/*
+ * Bulk prefetch all missing cache entries that are not GITLINKs and that match
+ * the given predicate. This function should only be called if
+ * has_promisor_remote() returns true.
+ */
+typedef int (*must_prefetch_predicate)(const struct cache_entry *);
+void prefetch_cache_entries(const struct index_state *istate,
+ must_prefetch_predicate must_prefetch);
+
#ifdef USE_THE_INDEX_COMPATIBILITY_MACROS
extern struct index_state the_index;