aboutsummaryrefslogtreecommitdiff
path: root/bundle.h
diff options
context:
space:
mode:
authorXing Xin <xingxin.xx@bytedance.com>2024-06-19 04:07:33 +0000
committerJunio C Hamano <gitster@pobox.com>2024-06-20 10:30:08 -0700
commit63d903ff52594eb52289abb89db1a4bca7b0f946 (patch)
tree88b62514ce41bf6a19fd91df18f00a4ca9216f1b /bundle.h
parentd0cbc75680405c85ecc3f91b12ac29b1a05a3fcf (diff)
downloadgit-63d903ff52594eb52289abb89db1a4bca7b0f946.tar.xz
unbundle: extend object verification for fetches
The existing fetch.fsckObjects and transfer.fsckObjects configurations were not fully applied to bundle-involved fetches, including direct bundle fetches and bundle-uri enabled fetches. Furthermore, there was no object verification support for unbundle. This commit extends object verification support in `bundle.c:unbundle` by adding the `VERIFY_BUNDLE_FSCK` option to `verify_bundle_flags`. When this option is enabled, we append the `--fsck-objects` flag to `git-index-pack`. The `VERIFY_BUNDLE_FSCK` option is now used by bundle-involved fetches, where we use `fetch-pack.c:fetch_pack_fsck_objects` to determine whether to enable this option for `bundle.c:unbundle`, specifically in: - `transport.c:fetch_refs_from_bundle` for direct bundle fetches. - `bundle-uri.c:unbundle_from_file` for bundle-uri enabled fetches. This addition ensures a consistent logic for object verification during fetches. Tests have been added to confirm functionality in the scenarios mentioned above. Reviewed-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Xing Xin <xingxin.xx@bytedance.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'bundle.h')
-rw-r--r--bundle.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/bundle.h b/bundle.h
index 021adbdcbb..5ccc9a061a 100644
--- a/bundle.h
+++ b/bundle.h
@@ -33,6 +33,7 @@ int create_bundle(struct repository *r, const char *path,
enum verify_bundle_flags {
VERIFY_BUNDLE_VERBOSE = (1 << 0),
VERIFY_BUNDLE_QUIET = (1 << 1),
+ VERIFY_BUNDLE_FSCK = (1 << 2),
};
int verify_bundle(struct repository *r, struct bundle_header *header,