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::{HashKind, 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 hash_kind: HashKind,
35 pub number: usize,
36 pub signature: ObjectHash,
37 pub objects: Vec<Box<dyn ObjectTrait>>,
38 pub pool: Arc<ThreadPool>,
39 pub waitlist: Arc<Waitlist>,
40 pub caches: Arc<Caches>,
41 pub mem_limit: Option<usize>,
42 pub cache_objs_mem: Arc<AtomicUsize>,
43 pub clean_tmp: bool,
44}
45
46#[cfg(test)]
47pub(crate) mod test_pack_download;
48
49#[cfg(test)]
50mod tests {
51 use tracing_subscriber::util::SubscriberInitExt;
52
53 pub(crate) fn init_logger() {
61 let _ = tracing_subscriber::fmt::Subscriber::builder()
62 .with_target(false)
63 .without_time()
64 .with_level(true)
65 .with_max_level(tracing::Level::DEBUG)
66 .finish()
67 .try_init(); }
69}