1pub mod init;
3
4mod find;
5#[cfg(not(feature = "wasm"))]
7pub mod write;
8
9pub mod verify {
11 use std::sync::atomic::AtomicBool;
12
13 use git_features::progress::Progress;
14
15 pub mod integrity {
17 pub struct Outcome<P> {
19 pub actual_index_checksum: git_hash::ObjectId,
21 pub pack_traverse_outcome: crate::index::traverse::Statistics,
23 pub progress: P,
25 }
26 }
27
28 use crate::Bundle;
29
30 impl Bundle {
31 pub fn verify_integrity<C, P, F>(
34 &self,
35 progress: P,
36 should_interrupt: &AtomicBool,
37 options: crate::index::verify::integrity::Options<F>,
38 ) -> Result<integrity::Outcome<P>, crate::index::traverse::Error<crate::index::verify::integrity::Error>>
39 where
40 P: Progress,
41 C: crate::cache::DecodeEntry,
42 F: Fn() -> C + Send + Clone,
43 {
44 self.index
45 .verify_integrity(
46 Some(crate::index::verify::PackContext {
47 data: &self.pack,
48 options,
49 }),
50 progress,
51 should_interrupt,
52 )
53 .map(|o| integrity::Outcome {
54 actual_index_checksum: o.actual_index_checksum,
55 pack_traverse_outcome: o.pack_traverse_statistics.expect("pack is set"),
56 progress: o.progress,
57 })
58 }
59 }
60}