index-pack: avoid immediate object fetch while parsing packfile

Prevent packfile parsing from accidentally dynamically fetching
each individual object found in the packfile.

When index-pack parses the input packfile, it does a lookup in the
ODB to test for conflicts/collisions.  This can accidentally cause
the object to be individually fetched when gvfs-helper (or
read-object-hook or partial-clone) is enabled.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
This commit is contained in:
Jeff Hostetler 2019-09-24 15:51:16 -04:00 коммит произвёл Johannes Schindelin
Родитель 5876f3cc60
Коммит d8f7578032
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -801,7 +801,7 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
if (startup_info->have_repository) {
read_lock();
collision_test_needed =
has_object_file_with_flags(oid, OBJECT_INFO_QUICK);
has_object_file_with_flags(oid, OBJECT_INFO_FOR_PREFETCH);
read_unlock();
}