Skip to content

Commit 5d5c46b

Browse files
committed
Merge branch 'ds/object-info-for-prefetch-fix'
Code cleanup and futureproof. * ds/object-info-for-prefetch-fix: sha1-file: split OBJECT_INFO_FOR_PREFETCH
2 parents 0aae918 + 31f5256 commit 5d5c46b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

object-store.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,14 @@ struct object_info {
277277
#define OBJECT_INFO_IGNORE_LOOSE 16
278278
/*
279279
* Do not attempt to fetch the object if missing (even if fetch_is_missing is
280-
* nonzero). This is meant for bulk prefetching of missing blobs in a partial
281-
* clone. Implies OBJECT_INFO_QUICK.
280+
* nonzero).
282281
*/
283-
#define OBJECT_INFO_FOR_PREFETCH (32 + OBJECT_INFO_QUICK)
282+
#define OBJECT_INFO_SKIP_FETCH_OBJECT 32
283+
/*
284+
* This is meant for bulk prefetching of missing blobs in a partial
285+
* clone. Implies OBJECT_INFO_SKIP_FETCH_OBJECT and OBJECT_INFO_QUICK
286+
*/
287+
#define OBJECT_INFO_FOR_PREFETCH (OBJECT_INFO_SKIP_FETCH_OBJECT | OBJECT_INFO_QUICK)
284288

285289
int oid_object_info_extended(struct repository *r,
286290
const struct object_id *,

sha1-file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ int oid_object_info_extended(struct repository *r, const struct object_id *oid,
13791379
/* Check if it is a missing object */
13801380
if (fetch_if_missing && repository_format_partial_clone &&
13811381
!already_retried && r == the_repository &&
1382-
!(flags & OBJECT_INFO_FOR_PREFETCH)) {
1382+
!(flags & OBJECT_INFO_SKIP_FETCH_OBJECT)) {
13831383
/*
13841384
* TODO Investigate having fetch_object() return
13851385
* TODO error/success and stopping the music here.

0 commit comments

Comments
 (0)