From ece9aea2c139764a82f162697586bc738873fb2f Mon Sep 17 00:00:00 2001 From: Jonathan Tan Date: Mon, 17 Aug 2020 12:48:19 -0700 Subject: fetch-pack: document only_packfile in get_pack() dd4b732df7 ("upload-pack: send part of packfile response as uri", 2020-06-10) added the "only_packfile" parameter to get_pack() but did not document it. Add documentation. Signed-off-by: Jonathan Tan Signed-off-by: Junio C Hamano --- fetch-pack.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fetch-pack.c') diff --git a/fetch-pack.c b/fetch-pack.c index 7f20eca4f8..289121038e 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -794,6 +794,10 @@ static void write_promisor_file(const char *keep_name, strbuf_release(&promisor_name); } +/* + * Pass 1 as "only_packfile" if the pack received is the only pack in this + * fetch request (that is, if there were no packfile URIs provided). + */ static int get_pack(struct fetch_pack_args *args, int xd[2], struct string_list *pack_lockfiles, int only_packfile, -- cgit v1.2.3 From 0bd96bea2f9718d2ce03e0bc4bbf0b5894f9b28e Mon Sep 17 00:00:00 2001 From: Jonathan Tan Date: Mon, 17 Aug 2020 12:48:20 -0700 Subject: 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 Signed-off-by: Junio C Hamano --- fetch-pack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fetch-pack.c') diff --git a/fetch-pack.c b/fetch-pack.c index 289121038e..0f1a84c061 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -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 -- cgit v1.2.3