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

Function get_git_path

src/commit.rs:19–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17}
18
19pub fn get_git_path() -> Result<PathBuf> {
20 let output = git_exec(&["rev-parse", "--absolute-git-dir"])?;
21 if !output.status.success() {
22 return Err(anyhow!(
23 "Failed to get git path. Make sure you are in a git repository"
24 ));
25 }
26 let path = String::from_utf8(output.stdout)?;
27 Ok(PathBuf::from(path.trim()))
28}
29
30pub fn commit(commit_message: &str) -> Result<()> {
31 let output = git_exec(&["commit", "-m", commit_message])?;

Callers 2

read_cached_commitFunction · 0.85
write_cached_commitFunction · 0.85

Calls 1

git_execFunction · 0.85

Tested by

no test coverage detected