MCPcopy Create free account
hub / github.com/AIScientists-Dev/Flowtrace / open_or_init

Function open_or_init

crates/flowtrace-cli/src/git.rs:69–73  ·  view source on GitHub ↗

Open the containing repo, or initialize one at `root` if no ancestor is a repo.

(root: &Path)

Source from the content-addressed store, hash-verified

67
68/// Open the containing repo, or initialize one at `root` if no ancestor is a repo.
69fn open_or_init(root: &Path) -> Result<Repository> {
70 open(root).or_else(|_| {
71 Repository::init(root).with_context(|| format!("git init at {}", root.display()))
72 })
73}
74
75/// Path inside the repo's working tree that points at `root`. Used to scope
76/// `add_all` pathspec and to translate caller-supplied "trace-relative"

Callers 2

initFunction · 0.85
commit_filesFunction · 0.85

Calls 2

openFunction · 0.85
initFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…