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

Function git

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

Source from the content-addressed store, hash-verified

121}
122
123fn git(root: &Path, args: &[&str]) -> String {
124 let output = Command::new("git")
125 .args(args)
126 .current_dir(root)
127 .env("GIT_AUTHOR_NAME", "CB-9C Tests")
128 .env("GIT_AUTHOR_EMAIL", "cb9c@example.com")
129 .env("GIT_COMMITTER_NAME", "CB-9C Tests")
130 .env("GIT_COMMITTER_EMAIL", "cb9c@example.com")
131 .output()
132 .expect("run git");
133 assert!(
134 output.status.success(),
135 "git {args:?} failed: {}",
136 String::from_utf8_lossy(&output.stderr)
137 );
138 String::from_utf8(output.stdout)
139 .expect("utf8 git output")
140 .trim()
141 .to_string()
142}
143
144fn git_commit(root: &Path, message: &str) -> String {
145 git(root, &["add", "-A", "--"]);

Calls 1

outputMethod · 0.45

Tested by

no test coverage detected