aboutsummaryrefslogtreecommitdiffstats
path: root/fetch-pack.h
diff options
context:
space:
mode:
authorXing Xin <xingxin.xx@bytedance.com>2024-06-19 04:07:32 +0000
committerJunio C Hamano <gitster@pobox.com>2024-06-20 10:30:07 -0700
commitd0cbc75680405c85ecc3f91b12ac29b1a05a3fcf (patch)
treeffb588756dd0d96487c73adf0d8da9f0bfc211b9 /fetch-pack.h
parentbundle-uri: verify oid before writing refs (diff)
downloadgit-d0cbc75680405c85ecc3f91b12ac29b1a05a3fcf.tar.gz
git-d0cbc75680405c85ecc3f91b12ac29b1a05a3fcf.zip
fetch-pack: expose fsckObjects configuration logic
Currently, we can use "transfer.fsckObjects" and the more specific "fetch.fsckObjects" to control checks for broken objects in received packs during fetches. However, these configurations were only acknowledged by `fetch-pack.c:get_pack` and did not take effect in direct bundle fetches or fetches with _bundle-uri_ enabled. This commit exposes the fetch-then-transfer configuration logic by adding a new function `fetch_pack_fsck_objects` in fetch-pack.h. This new function is used to replace the assignment for `fsck_objects` in `fetch-pack.c:get_pack`. In the next commit, this function will also be used to extend fsck support for bundle-involved fetches. Helped-by: Junio C Hamano <gitster@pobox.com> Helped-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 'fetch-pack.h')
-rw-r--r--fetch-pack.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fetch-pack.h b/fetch-pack.h
index 6775d26517..b5c579cdae 100644
--- a/fetch-pack.h
+++ b/fetch-pack.h
@@ -101,4 +101,9 @@ void negotiate_using_fetch(const struct oid_array *negotiation_tips,
*/
int report_unmatched_refs(struct ref **sought, int nr_sought);
+/*
+ * Return true if checks for broken objects in received pack are required.
+ */
+int fetch_pack_fsck_objects(void);
+
#endif