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

Function git

tests/core_cli_suite/tool_daemon_test.rs:57–88  ·  view source on GitHub ↗
(project: &Path, args: &[&str])

Source from the content-addressed store, hash-verified

55}
56
57fn git(project: &Path, args: &[&str]) {
58 let git = crate::common::git_program();
59 // Retry a transient spawn ENOENT under heavy parallel load.
60 let mut last_err: Option<std::io::Error> = None;
61 let mut output = None;
62 for attempt in 0..5 {
63 match std::process::Command::new(&git)
64 .args(args)
65 .current_dir(project)
66 .output()
67 {
68 Ok(out) => {
69 output = Some(out);
70 break;
71 }
72 Err(e) if e.kind() == std::io::ErrorKind::NotFound && attempt < 4 => {
73 last_err = Some(e);
74 std::thread::sleep(Duration::from_millis(20 * (attempt + 1)));
75 }
76 Err(e) => panic!("git {args:?} should run (program {git:?}): {e}"),
77 }
78 }
79 let output =
80 output.unwrap_or_else(|| panic!("git {args:?} should run after retries: {last_err:?}"));
81 assert!(
82 output.status.success(),
83 "git {:?} failed\nstdout:\n{}\nstderr:\n{}",
84 args,
85 String::from_utf8_lossy(&output.stdout),
86 String::from_utf8_lossy(&output.stderr)
87 );
88}
89
90fn tool_status_server_tool_calls(home: &Path, project: &Path) -> u64 {
91 let project_arg = project.to_string_lossy().to_string();

Calls 3

outputMethod · 0.80
kindMethod · 0.80
git_programFunction · 0.50

Tested by

no test coverage detected