Skip to content

Commit

Permalink
index-pack: avoid immediate object fetch while parsing packfile
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jeffhostetler authored and dscho committed Nov 8, 2023
1 parent a5b1bb7 commit 9fd2a2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/index-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
read_lock();
collision_test_needed =
repo_has_object_file_with_flags(the_repository, oid,
OBJECT_INFO_QUICK);
OBJECT_INFO_FOR_PREFETCH);
read_unlock();
}

Expand Down

0 comments on commit 9fd2a2f

Please sign in to comment.