From fc8a05b81ad268df4812cb166b74a62565148088 Mon Sep 17 00:00:00 2001 From: Alexander Lyon Date: Thu, 21 Mar 2024 15:58:27 +0000 Subject: [PATCH] feat: support apple git in scan diagnostic (#7740) ### Description macOS can have either Apple git or regular git depending on source. This PR adds support for the Apple git output format. Closes TURBO-2646 --- crates/turborepo-lib/src/diagnostics.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/turborepo-lib/src/diagnostics.rs b/crates/turborepo-lib/src/diagnostics.rs index 2ec056730dfdc..04f1c989b2c45 100644 --- a/crates/turborepo-lib/src/diagnostics.rs +++ b/crates/turborepo-lib/src/diagnostics.rs @@ -189,6 +189,13 @@ impl Diagnostic for GitDaemonDiagnostic { return; }; + // attempt to split out the apple git suffix + let version = if let Some((version, _)) = version.split_once(" (Apple") { + version + } else { + version + }; + let Ok(version) = semver::Version::parse(version) else { chan.failed("Failed to parse git version".to_string()).await; return;