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

Function git

atomic-repository/src/repository/anchor.rs:1722–1739  ·  view source on GitHub ↗
(root: &Path, args: &[&str])

Source from the content-addressed store, hash-verified

1720 use std::process::Command;
1721
1722 fn git(root: &Path, args: &[&str]) -> String {
1723 let output = Command::new("git")
1724 .args(args)
1725 .current_dir(root)
1726 .env("GIT_AUTHOR_NAME", "Atomic Tests")
1727 .env("GIT_AUTHOR_EMAIL", "tests@atomic.dev")
1728 .env("GIT_COMMITTER_NAME", "Atomic Tests")
1729 .env("GIT_COMMITTER_EMAIL", "tests@atomic.dev")
1730 .output()
1731 .unwrap();
1732 assert!(
1733 output.status.success(),
1734 "git {:?} failed: {}",
1735 args,
1736 String::from_utf8_lossy(&output.stderr)
1737 );
1738 String::from_utf8(output.stdout).unwrap().trim().to_string()
1739 }
1740
1741 /// Colocated fixture: an Atomic repository over a Git repository with one
1742 /// commit on `dev`.

Calls 2

unwrapMethod · 0.45
outputMethod · 0.45