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