Skip to content

Commit 4c0383b

Browse files
committed
fixup! index-pack: avoid immediate object fetch while parsing packfile
The previous fixup (cdaf540) replaced OBJECT_INFO_FOR_PREFETCH with HAS_OBJECT_FETCH_PROMISOR, reasoning that the former flag "never worked." However, these are flags for two different functions: OBJECT_INFO_FOR_PREFETCH was for odb_read_object_info_extended() (which the old oid_object_info_extended() forwarded to), while HAS_OBJECT_FETCH_PROMISOR is for odb_has_object(). The call site was migrated to odb_has_object() as part of the upstream refactoring, but odb_has_object(odb, oid, HAS_OBJECT_FETCH_PROMISOR) sets only OBJECT_INFO_QUICK without OBJECT_INFO_SKIP_FETCH_OBJECT, which means it WILL trigger remote fetches via gvfs-helper. This defeats the purpose of the original commit, which was to prevent index-pack from individually fetching every object it encounters during the collision check. Passing 0 instead gives us both OBJECT_INFO_QUICK and OBJECT_INFO_SKIP_FETCH_OBJECT, which is the correct equivalent of the original OBJECT_INFO_FOR_PREFETCH behavior. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent c4a5879 commit 4c0383b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

builtin/index-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
891891
if (startup_info->have_repository) {
892892
read_lock();
893893
collision_test_needed = odb_has_object(the_repository->objects, oid,
894-
HAS_OBJECT_FETCH_PROMISOR);
894+
0);
895895
read_unlock();
896896
}
897897

0 commit comments

Comments
 (0)