sha1-file: support OBJECT_INFO_FOR_PREFETCH
commit0f4a4fb1c4239a2aa46343add84ad6f99f6f3aae
authorJonathan Tan <jonathantanmy@google.com>
Fri, 29 Mar 2019 21:39:27 +0000 (29 14:39 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Apr 2019 06:47:15 +0000 (1 15:47 +0900)
tree64fc8e102e67f02a6ea922ad5debac1eb0bc1bac
parent041f5ea1cf987a4068ef5f39ba0a09be85952064
sha1-file: support OBJECT_INFO_FOR_PREFETCH

Teach oid_object_info_extended() to support a new flag that inhibits
fetching of missing objects. This is equivalent to setting
fetch_is_missing to 0, calling oid_object_info_extended(), then setting
fetch_if_missing to whatever it was before. Update unpack-trees.c to use
this new flag instead of repeatedly setting fetch_if_missing.

This new flag complicates things slightly in that there are now 2 ways
to do the same thing. But this eliminates the need to repeatedly set a
global variable, and more importantly, allows prefetching to be done in
parallel (in the future); hence, this patch.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
object-store.h
sha1-file.c
unpack-trees.c