]> git.ipfire.org Git - thirdparty/git.git/commit
cache-tree: prefetch in partial clone read-tree
authorJonathan Tan <jonathantanmy@google.com>
Fri, 23 Jul 2021 18:52:23 +0000 (11:52 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 23 Jul 2021 21:22:21 +0000 (14:22 -0700)
commitd3da223f2214ebc1527ccf66428aa975de916682
treeaae4dd727ca7149ef83b96b61859891a0c4ccda3
parentb2896d27391afcbc990439e63972bb33693a7d6b
cache-tree: prefetch in partial clone read-tree

"git read-tree" checks the existence of the blobs referenced by the
given tree, but does not bulk prefetch them. Add a bulk prefetch.

The lack of prefetch here was noticed at $DAYJOB during a merge
involving some specific commits, but I couldn't find a minimal merge
that didn't also trigger the prefetch in check_updates() in
unpack-trees.c (and in all these cases, the lack of prefetch in
cache-tree.c didn't matter because all the relevant blobs would have
already been prefetched by then). This is why I used read-tree here to
exercise this code path.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache-tree.c
t/t1022-read-tree-partial-clone.sh [new file with mode: 0755]