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

Function git

atomic-cli/build.rs:5–16  ·  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 if !output.status.success() {
13 return None;
14 }
15 String::from_utf8(output.stdout).ok()
16}
17
18fn short_commit(commit: &str) -> Option<&str> {
19 let commit = commit.trim();

Callers 2

watch_repositoryFunction · 0.70
mainFunction · 0.70

Calls 3

successMethod · 0.80
okMethod · 0.45
outputMethod · 0.45

Tested by

no test coverage detected