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

Function git

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

Source from the content-addressed store, hash-verified

56}
57
58fn git(root: &Path, args: &[&str]) -> String {
59 let output = Command::new("git")
60 .args(args)
61 .current_dir(root)
62 .env("GIT_AUTHOR_NAME", "CB-7A Tests")
63 .env("GIT_AUTHOR_EMAIL", "cb7a@example.com")
64 .env("GIT_COMMITTER_NAME", "CB-7A Tests")
65 .env("GIT_COMMITTER_EMAIL", "cb7a@example.com")
66 .output()
67 .expect("run git");
68 assert!(
69 output.status.success(),
70 "git {args:?} failed: {}",
71 String::from_utf8_lossy(&output.stderr)
72 );
73 String::from_utf8(output.stdout)
74 .expect("utf8 git output")
75 .trim()
76 .to_string()
77}
78
79fn git_ok(root: &Path, args: &[&str]) {
80 let _ = git(root, args);

Calls 1

outputMethod · 0.45

Tested by

no test coverage detected