gitpoulpi-cli-backend 1.1.1

GitBackend implementation that shells out to the system `git` binary, parsing only machine-readable output (porcelain v2, NUL-delimited logs).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use gitpoulpi_core::domain::{Oid, RepoRef, ResetMode};
use gitpoulpi_core::Result;

use crate::process::run;

pub fn reset(repo: &RepoRef, target: Oid, mode: ResetMode) -> Result<()> {
    let mode_flag = match mode {
        ResetMode::Soft => "--soft",
        ResetMode::Mixed => "--mixed",
        ResetMode::Hard => "--hard",
    };
    run(&repo.root, &["reset", mode_flag, &target.to_hex()])?;
    Ok(())
}