const HEADER_MAX_SIZE: usize = 64;
use std::path::{Path, PathBuf};
use gix_features::fs;
#[derive(Clone, PartialEq, Eq)]
pub struct Store {
pub(crate) path: PathBuf,
pub(crate) object_hash: gix_hash::Kind,
pub(crate) alloc_limit_bytes: Option<usize>,
}
impl Store {
pub fn at(
objects_directory: impl Into<PathBuf>,
object_hash: gix_hash::Kind,
alloc_limit_bytes: Option<usize>,
) -> Store {
Store {
path: objects_directory.into(),
object_hash,
alloc_limit_bytes,
}
}
pub fn path(&self) -> &Path {
&self.path
}
pub fn object_hash(&self) -> gix_hash::Kind {
self.object_hash
}
}
fn hash_path(id: &gix_hash::oid, mut root: PathBuf) -> PathBuf {
let mut hex = gix_hash::Kind::hex_buf();
let hex = id.hex_to_buf(hex.as_mut());
root.push(&hex[..2]);
root.push(&hex[2..]);
root
}
pub mod find;
pub mod iter;
pub mod verify;
pub struct Iter {
inner: fs::walkdir::DirEntryIter,
hash_hex_len: usize,
}
pub mod write;