use std::path::Path;
pub(crate) fn git_out(repo: &Path, args: &[&str]) -> String {
let out = crate::git_env::output(
crate::git_env::git()
.arg("-C")
.arg(repo)
.args(args)
.env("GIT_CONFIG_GLOBAL", "/dev/null")
.env("GIT_CONFIG_SYSTEM", "/dev/null"),
)
.unwrap();
assert!(out.status.success(), "git {args:?} failed");
String::from_utf8_lossy(&out.stdout).trim().to_owned()
}
pub(crate) fn run_git(repo: &Path, args: &[&str]) {
let mut cmd = crate::git_env::git();
cmd.arg("-C")
.arg(repo)
.args(args)
.env("GIT_AUTHOR_DATE", "2026-04-22T12:00:00Z")
.env("GIT_COMMITTER_DATE", "2026-04-22T12:00:00Z")
.env("GIT_CONFIG_GLOBAL", "/dev/null")
.env("GIT_CONFIG_SYSTEM", "/dev/null");
let status = crate::git_env::status(&mut cmd).unwrap();
assert!(status.success(), "git {args:?} failed");
}