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

Function git

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

Source from the content-addressed store, hash-verified

49}
50
51fn git(root: &Path, args: &[&str]) -> String {
52 let output = Command::new("git")
53 .args(args)
54 .current_dir(root)
55 .env("GIT_AUTHOR_NAME", "Tree Shape Tests")
56 .env("GIT_AUTHOR_EMAIL", "tree-shape@example.com")
57 .env("GIT_COMMITTER_NAME", "Tree Shape Tests")
58 .env("GIT_COMMITTER_EMAIL", "tree-shape@example.com")
59 .output()
60 .expect("run git");
61 assert!(
62 output.status.success(),
63 "git {args:?} failed: {}",
64 String::from_utf8_lossy(&output.stderr)
65 );
66 String::from_utf8(output.stdout)
67 .expect("utf8 git output")
68 .trim()
69 .to_string()
70}
71
72fn git_repo() -> (PathBuf, PathBuf) {
73 let root = tempfile::tempdir().unwrap().keep();

Callers 4

git_repoFunction · 0.70
commit_allFunction · 0.70

Calls 1

outputMethod · 0.45

Tested by

no test coverage detected