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

Function git

atomic-core/build.rs:5–17  ·  view source on GitHub ↗
(dir: &Path, args: &[&str])

Source from the content-addressed store, hash-verified

3use std::process::Command;
4
5fn git(dir: &Path, args: &[&str]) -> Option<String> {
6 let output = Command::new("git")
7 .arg("-C")
8 .arg(dir)
9 .args(args)
10 .output()
11 .ok()?;
12 output
13 .status
14 .success()
15 .then(|| String::from_utf8(output.stdout).ok())
16 .flatten()
17}
18
19fn main() {
20 println!("cargo:rerun-if-changed=build.rs");

Callers 1

mainFunction · 0.70

Calls 3

successMethod · 0.80
okMethod · 0.45
outputMethod · 0.45

Tested by

no test coverage detected