MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / git_program

Function git_program

src/branch/tests.rs:73–92  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71// --- git test harness (mirrors src/mcp/hook_events.rs tests) ------------
72
73fn git_program() -> std::ffi::OsString {
74 use std::sync::OnceLock;
75 static GIT: OnceLock<std::ffi::OsString> = OnceLock::new();
76 GIT.get_or_init(|| {
77 if let Some(explicit) = std::env::var_os("GIT") {
78 return explicit;
79 }
80 let exe_name = if cfg!(windows) { "git.exe" } else { "git" };
81 if let Some(paths) = std::env::var_os("PATH") {
82 for dir in std::env::split_paths(&paths) {
83 let candidate = dir.join(exe_name);
84 if candidate.is_file() {
85 return candidate.into_os_string();
86 }
87 }
88 }
89 std::ffi::OsString::from("git")
90 })
91 .clone()
92}
93
94fn run_git(cwd: &Path, args: &[&str]) {
95 assert!(cwd.is_dir(), "git cwd {cwd:?} should exist");

Callers 8

run_gitFunction · 0.70
git_scan_commitsFunction · 0.50
outputMethod · 0.50
git_outputFunction · 0.50
gitFunction · 0.50
head_oidFunction · 0.50
gitFunction · 0.50
file_churnFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected