@@ -782,7 +782,8 @@ 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_QUICK |
+ OBJECT_INFO_SKIP_FETCH_OBJECT);
read_unlock();
}
@@ -1673,14 +1674,6 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)
unsigned foreign_nr = 1; /* zero is a "good" value, assume bad */
int report_end_of_input = 0;
- /*
- * index-pack never needs to fetch missing objects except when
- * REF_DELTA bases are missing (which are explicitly handled). It only
- * accesses the repo to do hash collision checks and to check which
- * REF_DELTA bases need to be fetched.
- */
- fetch_if_missing = 0;
-
if (argc == 2 && !strcmp(argv[1], "-h"))
usage(index_pack_usage);