()
| 17 | } |
| 18 | |
| 19 | pub 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 | |
| 30 | pub fn commit(commit_message: &str) -> Result<()> { |
| 31 | let output = git_exec(&["commit", "-m", commit_message])?; |
no test coverage detected