MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / run_git

Function run_git

tests/session_suite/git_backfill.rs:28–41  ·  view source on GitHub ↗
(dir: &Path, args: &[&str], date: Option<i64>)

Source from the content-addressed store, hash-verified

26const T_BASE: i64 = 1_780_000_000;
27
28fn run_git(dir: &Path, args: &[&str], date: Option<i64>) {
29 let mut command = Command::new(common::git_program());
30 command.args(args).current_dir(dir);
31 if let Some(ts) = date {
32 let value = format!("{ts} +0000");
33 command
34 .env("GIT_AUTHOR_DATE", &value)
35 .env("GIT_COMMITTER_DATE", &value);
36 }
37 let status = command
38 .status()
39 .unwrap_or_else(|e| panic!("git {args:?} should spawn: {e}"));
40 assert!(status.success(), "git {args:?} should succeed");
41}
42
43/// Builds a repo on `main` with one commit at `T_BASE + 100`, a `feature`
44/// branch with a commit at `T_BASE + 400`, and a second `main` commit at

Callers 1

build_repoFunction · 0.70

Calls 2

statusMethod · 0.80
git_programFunction · 0.50

Tested by

no test coverage detected