diff --git a/core/cli/doctor.el b/core/cli/doctor.el index 72274ba85d1..21fdc20f864 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")))