refactor(cli): sweep 15 bail("git X") sites to use git_run with context labels

This commit is contained in:
adlee-was-taken
2026-05-08 22:10:25 -04:00
parent f3cdbed7b6
commit 97c8f994e1
6 changed files with 50 additions and 46 deletions

View File

@@ -4,10 +4,8 @@ use anyhow::Result;
pub fn cmd_sync() -> Result<()> {
let root = crate::helpers::vault_dir()?;
let pull = crate::helpers::git_command(&root, &["pull", "--rebase"]).status()?;
if !pull.success() { anyhow::bail!("git pull --rebase failed"); }
let push = crate::helpers::git_command(&root, &["push"]).status()?;
if !push.success() { anyhow::bail!("git push failed"); }
crate::helpers::git_run(&root, &["pull", "--rebase"], "sync: git pull --rebase")?;
crate::helpers::git_run(&root, &["push"], "sync: git push")?;
eprintln!("Sync complete.");
Ok(())
}