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
This commit is contained in:
Junio C Hamano
2020-09-03 12:37:01 -07:00
5 changed files with 72 additions and 1 deletions

View File

@ -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