#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
pub struct Location {
pub pack_id: u32,
pub index_file_id: u32,
pub entry_size: usize,
pub pack_offset: u64,
}
impl Location {
pub fn entry_range(&self, pack_offset: u64) -> crate::data::EntryRange {
pack_offset..pack_offset + self.entry_size as u64
}
}
pub mod init;
mod find;
pub mod write;
mod verify {
use std::sync::{atomic::AtomicBool, Arc};
use git_features::progress::Progress;
use crate::Bundle;
impl Bundle {
pub fn verify_integrity<C, P>(
&self,
verify_mode: crate::index::verify::Mode,
traversal: crate::index::traverse::Algorithm,
make_pack_lookup_cache: impl Fn() -> C + Send + Clone,
thread_limit: Option<usize>,
progress: Option<P>,
should_interrupt: Arc<AtomicBool>,
) -> Result<
(git_hash::ObjectId, Option<crate::index::traverse::Outcome>, Option<P>),
crate::index::traverse::Error<crate::index::verify::Error>,
>
where
P: Progress,
C: crate::cache::DecodeEntry,
{
self.index.verify_integrity(
Some((&self.pack, verify_mode, traversal, make_pack_lookup_cache)),
thread_limit,
progress,
should_interrupt,
)
}
}
}