git_internal/internal/pack/
mod.rs1pub mod cache;
5pub mod cache_object;
6pub mod channel_reader;
7pub mod decode;
8pub mod encode;
9pub mod entry;
10mod index_entry;
11pub mod pack_index;
12pub mod stats;
13pub mod utils;
14pub mod waitlist;
15pub mod wrapper;
16use std::sync::{Arc, atomic::AtomicUsize};
17
18use threadpool::ThreadPool;
19
20use crate::{
21 hash::ObjectHash,
22 internal::{
23 object::ObjectTrait,
24 pack::{cache::Caches, waitlist::Waitlist},
25 },
26};
27
28const DEFAULT_TMP_DIR: &str = "./.cache_temp";
29
30pub struct Pack {
32 pub number: usize,
33 pub signature: ObjectHash,
34 pub objects: Vec<Box<dyn ObjectTrait>>,
35 pub pool: Arc<ThreadPool>,
36 pub waitlist: Arc<Waitlist>,
37 pub caches: Arc<Caches>,
38 pub mem_limit: Option<usize>,
39 pub cache_objs_mem: Arc<AtomicUsize>,
40 pub clean_tmp: bool,
41}
42
43#[cfg(test)]
44pub(crate) mod test_pack_download;
45
46#[cfg(test)]
47mod tests {
48 use tracing_subscriber::util::SubscriberInitExt;
49
50 pub(crate) fn init_logger() {
58 let _ = tracing_subscriber::fmt::Subscriber::builder()
59 .with_target(false)
60 .without_time()
61 .with_level(true)
62 .with_max_level(tracing::Level::DEBUG)
63 .finish()
64 .try_init(); }
66}