branch: elpa/magit
commit 71535990381f0b12d5dc1dae0f265ce42336c4ad
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>

    magit-cygwin-mount-points: Fix regression
    
    In [1: 7fe84a4cd0] we started using the new `magit--early-process-lines'
    but that did not take into account that `string-match-p' may end up with
    nil as STRING, which is a type error.
    
    Closes #5548.
---
 lisp/magit-git.el | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index 1ce4fc2855..e4b8ae0cc8 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -1275,11 +1275,10 @@ or if no rename is detected."
                             "Failed to parse Cygwin mount: %S" mount)))
                  ;; If --exec-path is not a native Windows path,
                  ;; then we probably have a cygwin git.
-                 (and (not (string-match-p
-                            "\\`[a-zA-Z]:"
-                            (car (magit--early-process-lines
-                                  magit-git-executable "--exec-path"))))
-                      (magit--early-process-lines "mount")))
+                 (and-let ((dirs (magit--early-process-lines
+                                  magit-git-executable "--exec-path")))
+                   (and (not (string-match-p "\\`[a-zA-Z]:" (car dir)))
+                        (magit--early-process-lines "mount"))))
                 #'> :key (pcase-lambda (`(,cyg . ,_win)) (length cyg))))
   "Alist of (CYGWIN . WIN32) directory names.
 Sorted from longest to shortest CYGWIN name."

Reply via email to