fetch-pack: make packfile URIs work with transfer.fsckobjects

When fetching with packfile URIs and transfer.fsckobjects=1, use the
--fsck-objects instead of the --strict flag when invoking index-pack so
that links are not checked, only objects. This is because incomplete
links are expected. (A subsequent connectivity check will be done when
all the packs have been downloaded regardless of whether
transfer.fsckobjects is set.)

This is similar to 98a2ea46c2 ("fetch-pack: do not check links for
partial fetch", 2018-03-15), but for packfile URIs instead of partial
clones.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jonathan Tan
2020-08-17 12:48:20 -07:00
committed by Junio C Hamano
parent ece9aea2c1
commit 0bd96bea2f
2 changed files with 54 additions and 1 deletions

View File

@ -896,7 +896,7 @@ static int get_pack(struct fetch_pack_args *args,
: transfer_fsck_objects >= 0
? transfer_fsck_objects
: 0) {
if (args->from_promisor)
if (args->from_promisor || !only_packfile)
/*
* We cannot use --strict in index-pack because it
* checks both broken objects and links, but we only