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 utils;
13pub mod waitlist;
14pub mod wrapper;
15use std::sync::{Arc, atomic::AtomicUsize};
16
17use threadpool::ThreadPool;
18
19use crate::{
20 hash::ObjectHash,
21 internal::{
22 object::ObjectTrait,
23 pack::{cache::Caches, waitlist::Waitlist},
24 },
25};
26
27const DEFAULT_TMP_DIR: &str = "./.cache_temp";
28
29pub struct Pack {
31 pub number: usize,
32 pub signature: ObjectHash,
33 pub objects: Vec<Box<dyn ObjectTrait>>,
34 pub pool: Arc<ThreadPool>,
35 pub waitlist: Arc<Waitlist>,
36 pub caches: Arc<Caches>,
37 pub mem_limit: Option<usize>,
38 pub cache_objs_mem: Arc<AtomicUsize>,
39 pub clean_tmp: bool,
40}
41
42#[cfg(test)]
43mod tests {
44 use tracing_subscriber::util::SubscriberInitExt;
45
46 pub(crate) fn init_logger() {
54 let _ = tracing_subscriber::fmt::Subscriber::builder()
55 .with_target(false)
56 .without_time()
57 .with_level(true)
58 .with_max_level(tracing::Level::DEBUG)
59 .finish()
60 .try_init(); }
62}