Skip to content

Commit 82f7473

Browse files
committed
index-pack: remove fetch_if_missing=0
Commit 6462d5e ("fetch: remove fetch_if_missing=0", 2019-11-08) strove to remove the need for fetch_if_missing=0 from the fetching mechanism, so it is plausible to attempt removing fetch_if_missing=0 from index-pack as well. Signed-off-by: Hariom Verma <hariom18599@gmail.com>
1 parent eb0cbee commit 82f7473

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

builtin/index-pack.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,8 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
782782
if (startup_info->have_repository) {
783783
read_lock();
784784
collision_test_needed =
785-
has_object_file_with_flags(oid, OBJECT_INFO_QUICK);
785+
has_object_file_with_flags(oid, OBJECT_INFO_QUICK |
786+
OBJECT_INFO_SKIP_FETCH_OBJECT);
786787
read_unlock();
787788
}
788789

@@ -1673,14 +1674,6 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)
16731674
unsigned foreign_nr = 1; /* zero is a "good" value, assume bad */
16741675
int report_end_of_input = 0;
16751676

1676-
/*
1677-
* index-pack never needs to fetch missing objects except when
1678-
* REF_DELTA bases are missing (which are explicitly handled). It only
1679-
* accesses the repo to do hash collision checks and to check which
1680-
* REF_DELTA bases need to be fetched.
1681-
*/
1682-
fetch_if_missing = 0;
1683-
16841677
if (argc == 2 && !strcmp(argv[1], "-h"))
16851678
usage(index_pack_usage);
16861679

0 commit comments

Comments
 (0)