Skip to main content

GitCli

Trait GitCli 

Source
pub trait GitCli {
    // Required method
    fn run_raw(&self, repo: &Path, args: &[&str]) -> Result<GitOutput>;

    // Provided method
    fn run(&self, repo: &Path, args: &[&str]) -> Result<String> { ... }
}
Expand description

Runs git subcommands in a repository. Mutations and network operations go through this boundary (reads use gix where possible).

Required Methods§

Source

fn run_raw(&self, repo: &Path, args: &[&str]) -> Result<GitOutput>

Runs git -C <repo> <args>, capturing output. Returns the captured GitOutput even on a non-zero exit; errors only if the process cannot be spawned.

Provided Methods§

Source

fn run(&self, repo: &Path, args: &[&str]) -> Result<String>

Runs git, returning stdout on success or an Error::Subprocess with captured stderr on failure. Lock contention is annotated with a hint (spec §12).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§