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

Function run

crates/opencode-util/src/util.rs:187–202  ·  view source on GitHub ↗
(args: &[&str], cwd: &Path)

Source from the content-addressed store, hash-verified

185 }
186
187 pub fn run(args: &[&str], cwd: &Path) -> GitResult {
188 let output = Command::new("git").args(args).current_dir(cwd).output();
189
190 match output {
191 Ok(output) => GitResult {
192 exit_code: output.status.code().unwrap_or(1),
193 stdout: String::from_utf8_lossy(&output.stdout).to_string(),
194 stderr: String::from_utf8_lossy(&output.stderr).to_string(),
195 },
196 Err(e) => GitResult {
197 exit_code: 1,
198 stdout: String::new(),
199 stderr: e.to_string(),
200 },
201 }
202 }
203
204 pub fn is_repo(path: &Path) -> bool {
205 path.join(".git").exists()

Callers 5

get_rootFunction · 0.85
get_current_branchFunction · 0.85
get_remote_urlFunction · 0.85
get_head_commitFunction · 0.85
get_statusFunction · 0.85

Calls 2

newFunction · 0.85
outputMethod · 0.80

Tested by

no test coverage detected