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

Function git

atomic-cli/tests/it/git_import_cb9a_test.rs:50–69  ·  view source on GitHub ↗
(root: &Path, args: &[&str])

Source from the content-addressed store, hash-verified

48}
49
50fn git(root: &Path, args: &[&str]) -> String {
51 let output = Command::new("git")
52 .args(args)
53 .current_dir(root)
54 .env("GIT_AUTHOR_NAME", "CB-9A Tests")
55 .env("GIT_AUTHOR_EMAIL", "cb9a@example.com")
56 .env("GIT_COMMITTER_NAME", "CB-9A Tests")
57 .env("GIT_COMMITTER_EMAIL", "cb9a@example.com")
58 .output()
59 .expect("run git");
60 assert!(
61 output.status.success(),
62 "git {args:?} failed: {}",
63 String::from_utf8_lossy(&output.stderr)
64 );
65 String::from_utf8(output.stdout)
66 .expect("utf8 git output")
67 .trim()
68 .to_string()
69}
70
71/// Fixture: a Git repository with a root commit (nested paths) and a
72/// single-parent follow-up (modification), plus the SHAs and trees of both.

Calls 1

outputMethod · 0.45

Tested by

no test coverage detected