Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2021-07-23 21:52:22 +0300
committerJunio C Hamano <gitster@pobox.com>2021-07-24 00:21:57 +0300
commitb2896d27391afcbc990439e63972bb33693a7d6b (patch)
tree952dfb651420982f59f61cb4b2ed6d62a17effb8 /cache.h
parenteb27b338a3e71c7c4079fbac8aeae3f8fbb5c687 (diff)
unpack-trees: refactor prefetching code
Refactor the prefetching code in unpack-trees.c into its own function, because it will be used elsewhere in a subsequent commit. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 ba04ff8bd3..6f952e22c6 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;