MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / git

Function git

libatomic/examples/agent_sandbox_bench.rs:229–254  ·  view source on GitHub ↗
(root: &Path, args: &[&str], tick: Option<usize>)

Source from the content-addressed store, hash-verified

227
228#[cfg(unix)]
229fn git(root: &Path, args: &[&str], tick: Option<usize>) -> Result<()> {
230 let output = Command::new("git")
231 .args(args)
232 .current_dir(root)
233 .env("GIT_AUTHOR_NAME", "bench")
234 .env("GIT_AUTHOR_EMAIL", "bench@example.invalid")
235 .env("GIT_COMMITTER_NAME", "bench")
236 .env("GIT_COMMITTER_EMAIL", "bench@example.invalid")
237 .env(
238 "GIT_AUTHOR_DATE",
239 format!("{} +0000", 1_600_000_000 + tick.unwrap_or(0)),
240 )
241 .env(
242 "GIT_COMMITTER_DATE",
243 format!("{} +0000", 1_600_000_000 + tick.unwrap_or(0)),
244 )
245 .output()
246 .with_context(|| format!("running git {}", args.join(" ")))?;
247 ensure!(
248 output.status.success(),
249 "git {} failed: {}",
250 args.join(" "),
251 String::from_utf8_lossy(&output.stderr)
252 );
253 Ok(())
254}
255
256/// Build the atomic host repository and the Git bare repository with the
257/// same synthetic content. Returns the atomic golden and the bare path.

Callers 3

prepare_fixturesFunction · 0.70
git_clone_fullFunction · 0.70
bridge_checkpointFunction · 0.50

Calls 2

with_contextMethod · 0.45
outputMethod · 0.45

Tested by 1

bridge_checkpointFunction · 0.40