From 7b5baf319b54d0decfb94ce9095c6bb19dd0e6e1 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 25 May 2021 10:30:13 -0400 Subject: [PATCH] Fix #5093: git version doctor check on macOS git version's output is formatted differently on macOS (because of course it is), so I use a more flexible check. --- core/cli/doctor.el | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/core/cli/doctor.el b/core/cli/doctor.el index 72274ba85..21fdc20f8 100644 --- a/core/cli/doctor.el +++ b/core/cli/doctor.el @@ -62,12 +62,17 @@ in." (print-group! (if (not (executable-find "git")) (error! "Couldn't find git on your machine! Doom's package manager won't work.") - (let ((version (cadr (split-string - (cdr (doom-call-process "git" "version")) - " version ")))) - (when (version< version "2.28") - (error! "Git %s detected! Doom requires git 2.28 or newer!" - version)))) + (save-match-data + (let* ((version + (cdr (doom-call-process "git" "version"))) + (version + (and (string-match "\\_<[0-9]+\\.[0-9]+\\(\\.[0-9]+\\)\\_>" version) + (match-string 0 version)))) + (if version + (when (version< version "2.28") + (error! "Git %s detected! Doom requires git 2.28 or newer!" + version)) + (warn! "Cannot determine Git version. Doom requires git 2.28 or newer!"))))) (unless (executable-find "rg") (error! "Couldn't find the `rg' binary; this a hard dependecy for Doom, file searches may not work at all")))