diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-08-04 20:53:58 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-08-04 20:53:58 (GMT) |
commit | 5b137e84410ff7c83b854cb7b9e933c4d3673555 (patch) | |
tree | 3ae3acf1f19afaba2c07a35fbd9992f300a00720 /sha1-file.c | |
parent | 5c454b3825777493eada736423db75e8b128dd83 (diff) | |
parent | a64d2aae5a593f4fb8b2020dc39556b256d1846e (diff) | |
download | git-5b137e84410ff7c83b854cb7b9e933c4d3673555.zip git-5b137e84410ff7c83b854cb7b9e933c4d3673555.tar.gz git-5b137e84410ff7c83b854cb7b9e933c4d3673555.tar.bz2 |
Merge branch 'jt/pretend-object-never-come-from-elsewhere'
The pretend-object mechanism checks if the given object already
exists in the object store before deciding to keep the data
in-core, but the check would have triggered lazy fetching of such
an object from a promissor remote.
* jt/pretend-object-never-come-from-elsewhere:
sha1-file: make pretend_object_file() not prefetch
Diffstat (limited to 'sha1-file.c')
-rw-r--r-- | sha1-file.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sha1-file.c b/sha1-file.c index ccd34dd..45fdb84 100644 --- a/sha1-file.c +++ b/sha1-file.c @@ -1600,7 +1600,8 @@ int pretend_object_file(void *buf, unsigned long len, enum object_type type, struct cached_object *co; hash_object_file(the_hash_algo, buf, len, type_name(type), oid); - if (has_object_file(oid) || find_cached_object(oid)) + if (has_object_file_with_flags(oid, OBJECT_INFO_QUICK | OBJECT_INFO_SKIP_FETCH_OBJECT) || + find_cached_object(oid)) return 0; ALLOC_GROW(cached_objects, cached_object_nr + 1, cached_object_alloc); co = &cached_objects[cached_object_nr++]; |