MCPcopy Index your code
hub / github.com/alt-art/commit / git_exec

Function git_exec

src/commit.rs:8–17  ·  view source on GitHub ↗
(args: &[&str])

Source from the content-addressed store, hash-verified

6use std::{fs, thread};
7
8pub fn git_exec(args: &[&str]) -> Result<Output> {
9 let output = Command::new("git").args(args).output();
10 match output {
11 Ok(output) => Ok(output),
12 Err(e) => Err(anyhow!(
13 "Failed to run git. Make sure git is installed\nAdditional info: {}",
14 e
15 )),
16 }
17}
18
19pub fn get_git_path() -> Result<PathBuf> {
20 let output = git_exec(&["rev-parse", "--absolute-git-dir"])?;

Callers 4

get_git_pathFunction · 0.85
commitFunction · 0.85
check_staged_filesFunction · 0.85
git_add_all_modifiedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected