diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-07-08 14:53:11 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-07-08 14:53:11 -0700 |
commit | 125e38947087906be17fb4e237fc09764df97c65 (patch) | |
tree | d3a5a64bacceb6485f186f99048cce117de76dbc /fetch-pack.c | |
parent | 3997614c249b4b475d07c00556446d8b698d1a49 (diff) | |
parent | 63d903ff52594eb52289abb89db1a4bca7b0f946 (diff) |
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
Diffstat (limited to 'fetch-pack.c')
-rw-r--r-- | fetch-pack.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/fetch-pack.c b/fetch-pack.c index ea8655de31..732511604b 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -956,12 +956,7 @@ static int get_pack(struct fetch_pack_args *args, strvec_push(&cmd.args, alternate_shallow_file); } - if (fetch_fsck_objects >= 0 - ? fetch_fsck_objects - : transfer_fsck_objects >= 0 - ? transfer_fsck_objects - : 0) - fsck_objects = 1; + fsck_objects = fetch_pack_fsck_objects(); if (do_keep || args->from_promisor || index_pack_args || fsck_objects) { if (pack_lockfiles || fsck_objects) @@ -2050,6 +2045,16 @@ static const struct object_id *iterate_ref_map(void *cb_data) return &ref->old_oid; } +int fetch_pack_fsck_objects(void) +{ + fetch_pack_setup(); + if (fetch_fsck_objects >= 0) + return fetch_fsck_objects; + if (transfer_fsck_objects >= 0) + return transfer_fsck_objects; + return 0; +} + struct ref *fetch_pack(struct fetch_pack_args *args, int fd[], const struct ref *ref, |