refactor(cli): sweep 15 bail("git X") sites to use git_run with context labels
This commit is contained in:
@@ -32,10 +32,12 @@ pub(crate) fn commit_paths(
|
||||
) -> Result<()> {
|
||||
let mut args: Vec<&str> = vec!["add"];
|
||||
args.extend_from_slice(paths);
|
||||
let status = crate::helpers::git_command(vault.root(), &args).status()?;
|
||||
if !status.success() { anyhow::bail!("git add failed"); }
|
||||
let status = crate::helpers::git_command(vault.root(), &["commit", "-m", message]).status()?;
|
||||
if !status.success() { anyhow::bail!("git commit failed"); }
|
||||
crate::helpers::git_run(vault.root(), &args, &format!("commit \"{message}\": git add"))?;
|
||||
crate::helpers::git_run(
|
||||
vault.root(),
|
||||
&["commit", "-m", message],
|
||||
&format!("commit \"{message}\": git commit"),
|
||||
)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user