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

Function render_shim

atomic-cli/src/commands/diagnostics/render.rs:303–336  ·  view source on GitHub ↗
(o: &mut String, report: &Report)

Source from the content-addressed store, hash-verified

301}
302
303fn render_shim(o: &mut String, report: &Report) {
304 section(o, "Git shim");
305 let shim = &report.git_shim;
306 let status = match shim.status {
307 ShimStatus::Enabled => "yes ([git.shim] enabled = true)".to_string(),
308 ShimStatus::Disabled => "no".to_string(),
309 ShimStatus::NotApplicable => format!(
310 "not applicable — {}",
311 shim.reason.as_deref().unwrap_or("no workspace")
312 ),
313 ShimStatus::Unknown => format!(
314 "unknown — {}",
315 shim.reason.as_deref().unwrap_or("not readable")
316 ),
317 };
318 field(o, "Enabled", &status);
319 match &shim.hooks {
320 GitHooks::NotApplicable => {}
321 GitHooks::NoGitRepository => field(o, "Git hooks", "no Git repository in this workspace"),
322 GitHooks::ExternallyManaged { hooks_path } => field(
323 o,
324 "Git hooks",
325 &format!("managed outside Atomic (core.hooksPath = {hooks_path})"),
326 ),
327 GitHooks::Unreadable { reason } => field(o, "Git hooks", &format!("unknown — {reason}")),
328 GitHooks::Inspected { dispatchers } => {
329 field(o, "Git hooks", "");
330 for dispatcher in dispatchers {
331 line(o, &format!(" {}: {}", dispatcher.hook, dispatcher.label));
332 }
333 }
334 }
335 blank(o);
336}
337
338fn section(o: &mut String, title: &str) {
339 line(o, title);

Callers 1

render_textFunction · 0.85

Calls 4

lineFunction · 0.85
blankFunction · 0.85
sectionFunction · 0.70
fieldFunction · 0.70

Tested by

no test coverage detected