Merge branch 'xx/bundie-uri-fixes'

When bundleURI interface fetches multiple bundles, Git failed to
take full advantage of all bundles and ended up slurping duplicated
objects.

* xx/bundie-uri-fixes:
  unbundle: extend object verification for fetches
  fetch-pack: expose fsckObjects configuration logic
  bundle-uri: verify oid before writing refs
This commit is contained in:
Junio C Hamano
2024-07-08 14:53:11 -07:00
8 changed files with 243 additions and 14 deletions

View File

@ -11,6 +11,7 @@
#include "hashmap.h"
#include "pkt-line.h"
#include "config.h"
#include "fetch-pack.h"
#include "remote.h"
static struct {
@ -375,7 +376,7 @@ static int unbundle_from_file(struct repository *r, const char *file)
* the prerequisite commits.
*/
if ((result = unbundle(r, &header, bundle_fd, NULL,
VERIFY_BUNDLE_QUIET)))
VERIFY_BUNDLE_QUIET | (fetch_pack_fsck_objects() ? VERIFY_BUNDLE_FSCK : 0))))
return 1;
/*
@ -402,8 +403,7 @@ static int unbundle_from_file(struct repository *r, const char *file)
refs_update_ref(get_main_ref_store(the_repository),
"fetched bundle", bundle_ref.buf, oid,
has_old ? &old_oid : NULL,
REF_SKIP_OID_VERIFICATION,
UPDATE_REFS_MSG_ON_ERR);
0, UPDATE_REFS_MSG_ON_ERR);
}
bundle_header_release(&header);