Harness the power of signify(1) to sign arbitrary git objects
1//! Pull data from a remote repo.
2
3use std::process::Command;
4
5use anyhow::{anyhow, Context, Result};
6
7use crate::utils::ALL_SIGNIFY_REFS;
8
9/// Execute the `pull` command.
10pub fn command(remote: &str) -> Result<()> {
11 let exit_code = Command::new("git")
12 .arg("fetch")
13 .arg(remote)
14 .arg(format!("{ALL_SIGNIFY_REFS}:{ALL_SIGNIFY_REFS}"))
15 .spawn()
16 .context("Failed to spawn git command")?
17 .wait()
18 .context("Failed to wait for git command")?;
19 if exit_code.success() {
20 Ok(())
21 } else {
22 Err(anyhow!("Exit code of git: {exit_code}"))
23 }
24}