MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / get_root

Function get_root

crates/opencode-util/src/util.rs:208–215  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

206 }
207
208 pub fn get_root(path: &Path) -> Option<std::path::PathBuf> {
209 let result = run(&["rev-parse", "--show-toplevel"], path);
210 if result.success() {
211 Some(std::path::PathBuf::from(result.stdout.trim()))
212 } else {
213 None
214 }
215 }
216
217 pub fn get_current_branch(path: &Path) -> Option<String> {
218 let result = run(&["branch", "--show-current"], path);

Callers

nothing calls this directly

Calls 2

runFunction · 0.85
successMethod · 0.45

Tested by

no test coverage detected