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

Function get_current_branch

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

Source from the content-addressed store, hash-verified

215 }
216
217 pub fn get_current_branch(path: &Path) -> Option<String> {
218 let result = run(&["branch", "--show-current"], path);
219 if result.success() {
220 Some(result.stdout.trim().to_string())
221 } else {
222 None
223 }
224 }
225
226 pub fn get_remote_url(path: &Path) -> Option<String> {
227 let result = run(&["remote", "get-url", "origin"], path);

Callers

nothing calls this directly

Calls 2

runFunction · 0.85
successMethod · 0.45

Tested by

no test coverage detected