use std::path::PathBuf;
mod error {
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("There was an error accessing the store's directory")]
Io(#[from] std::io::Error),
}
}
pub use error::Error;
use crate::file;
#[expect(
dead_code,
reason = "callers still initialize file::Store directly while the general store awaits ref-table support"
)]
impl crate::Store {
pub fn at(git_dir: PathBuf, object_hash: gix_hash::Kind) -> Result<Self, Error> {
Self::at_opts(git_dir, object_hash, Default::default())
}
pub fn at_opts(
git_dir: PathBuf,
object_hash: gix_hash::Kind,
opts: crate::store::init::Options,
) -> Result<Self, Error> {
std::fs::read_dir(&git_dir)?;
Ok(crate::Store {
inner: crate::store::State::Loose {
store: file::Store::at_opts(git_dir, object_hash, opts),
},
})
}
}