diff options
author | Jonathan Tan <jonathantanmy@google.com> | 2019-03-30 00:39:27 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-04-01 09:47:15 +0300 |
commit | 0f4a4fb1c4239a2aa46343add84ad6f99f6f3aae (patch) | |
tree | 64fc8e102e67f02a6ea922ad5debac1eb0bc1bac /object-store.h | |
parent | 041f5ea1cf987a4068ef5f39ba0a09be85952064 (diff) |
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>
Diffstat (limited to 'object-store.h')
-rw-r--r-- | object-store.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/object-store.h b/object-store.h index 14fc935bd1..dd3f9b75f0 100644 --- a/object-store.h +++ b/object-store.h @@ -280,6 +280,12 @@ struct object_info { #define OBJECT_INFO_QUICK 8 /* Do not check loose object */ #define OBJECT_INFO_IGNORE_LOOSE 16 +/* + * Do not attempt to fetch the object if missing (even if fetch_is_missing is + * nonzero). This is meant for bulk prefetching of missing blobs in a partial + * clone. Implies OBJECT_INFO_QUICK. + */ +#define OBJECT_INFO_FOR_PREFETCH (32 + OBJECT_INFO_QUICK) int oid_object_info_extended(struct repository *r, const struct object_id *, |