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

Function git

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

Source from the content-addressed store, hash-verified

82}
83
84fn git(root: &Path, args: &[&str]) -> String {
85 let output = Command::new("git")
86 .args(args)
87 .current_dir(root)
88 .env("GIT_AUTHOR_NAME", "CB-9B Tests")
89 .env("GIT_AUTHOR_EMAIL", "cb9b@example.com")
90 .env("GIT_COMMITTER_NAME", "CB-9B Tests")
91 .env("GIT_COMMITTER_EMAIL", "cb9b@example.com")
92 .output()
93 .expect("run git");
94 assert!(
95 output.status.success(),
96 "git {args:?} failed: {}",
97 String::from_utf8_lossy(&output.stderr)
98 );
99 String::from_utf8(output.stdout)
100 .expect("utf8 git output")
101 .trim()
102 .to_string()
103}
104
105fn git_commit(root: &Path, message: &str) -> String {
106 git(root, &["add", "."]);

Calls 1

outputMethod · 0.45

Tested by

no test coverage detected