(o: &mut String, report: &Report)
| 301 | } |
| 302 | |
| 303 | fn 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 | |
| 338 | fn section(o: &mut String, title: &str) { |
| 339 | line(o, title); |
no test coverage detected