aboutsummaryrefslogtreecommitdiffstats
path: root/fetch-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-09-03 12:37:01 -0700
committerJunio C Hamano <gitster@pobox.com>2020-09-03 12:37:01 -0700
commitbdccf5e086e5e45e5feccc22f9da0633c2492da1 (patch)
treebc91bd2d76286801ab6064cfc0c954ae25e4ece7 /fetch-pack.c
parent3cbff011b0f7fd5b50983f01337a3204559e25b7 (diff)
parent0bd96bea2f9718d2ce03e0bc4bbf0b5894f9b28e (diff)
downloadgit-bdccf5e086e5e45e5feccc22f9da0633c2492da1.tar.gz
Merge branch 'jt/fetch-pack-loosen-validation-with-packfile-uri'
Bugfix for "git fetch" when the packfile URI capability is in use. * jt/fetch-pack-loosen-validation-with-packfile-uri: fetch-pack: make packfile URIs work with transfer.fsckobjects fetch-pack: document only_packfile in get_pack() (various): document from_promisor parameter
Diffstat (limited to 'fetch-pack.c')
-rw-r--r--fetch-pack.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index d467edc24e..5eb6ed6165 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,
@@ -895,7 +899,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