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, 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(git_dir, opts),
},
})
}
}