MCPcopy Create free account
hub / github.com/emwalker/digraph / load

Method load

backend/src/git/index.rs:198–211  ·  view source on GitHub ↗
(filename: &PathBuf, view: &core::View)

Source from the content-addressed store, hash-verified

196 }
197
198 pub fn load(filename: &PathBuf, view: &core::View) -> Result<Self> {
199 let index = if view.blob_exists(filename)? {
200 match view.find_blob_by_filename(filename)? {
201 Some(blob) => Self {
202 filename: filename.to_owned(),
203 index: blob.try_into()?,
204 },
205 None => Self::new(filename),
206 }
207 } else {
208 Self::new(filename)
209 };
210 Ok(index)
211 }
212
213 pub fn make(filename: PathBuf, index: SynonymIndexMap) -> Self {
214 Self { filename, index }

Callers

nothing calls this directly

Calls 3

blob_existsMethod · 0.80
find_blob_by_filenameMethod · 0.80
try_intoMethod · 0.45

Tested by

no test coverage detected