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

Method open

backend/src/git/core/mod.rs:44–52  ·  view source on GitHub ↗
(path: PathBuf)

Source from the content-addressed store, hash-verified

42 }
43
44 pub fn open(path: PathBuf) -> Result<Self> {
45 match git2::Repository::open(&path) {
46 Ok(repo) => Ok(Repo { inner: repo, path }),
47 Err(err) => match err.code() {
48 git2::ErrorCode::NotFound => Self::init(&path),
49 _ => Err(Error::Repo(format!("unable to open repo: {path:?}"))),
50 },
51 }
52 }
53
54 pub fn delete(root: &DataRoot, repo_id: RepoId) -> Result<()> {
55 let path = root.repo_path(repo_id);

Callers

nothing calls this directly

Calls 2

initFunction · 0.85
RepoClass · 0.85

Tested by

no test coverage detected