diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2026-04-08 08:46:22 +0200 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2026-04-08 08:46:22 +0200 |
| commit | 9ae0e7ac4c3fb64a1bfc46329ee974f79c2b1396 (patch) | |
| tree | 6958bb37c3d68c859d97d09bcd6cadd6f24135ac | |
| parent | 61950fca5e31c9a33d839b3994d93be6d370fb4c (diff) | |
magit-cygwin-mount-points: Move definition
| -rw-r--r-- | lisp/magit-git.el | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/lisp/magit-git.el b/lisp/magit-git.el index 8c75e56..d66311d 100644 --- a/lisp/magit-git.el +++ b/lisp/magit-git.el @@ -281,6 +281,28 @@ framework ultimately determines how the collection is displayed." :group 'magit-miscellaneous :type '(choice string (repeat string))) +(defcustom magit-cygwin-mount-points + (and (eq system-type 'windows-nt) + (cl-sort (mapcar + (lambda (mount) + (if (string-match "^\\(.*\\) on \\(.*\\) type" mount) + (cons (file-name-as-directory (match-str 2 mount)) + (file-name-as-directory (match-str 1 mount))) + (lwarn '(magit) :error + "Failed to parse Cygwin mount: %S" mount))) + ;; If --exec-path is not a native Windows path, + ;; then we probably have a cygwin git. + (and-let ((dirs (magit--early-process-lines + magit-git-executable "--exec-path"))) + (and (not (string-match-p "\\`[a-zA-Z]:" (car dirs))) + (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." + :package-version '(magit . "2.3.0") + :group 'magit-process + :type '(alist :key-type string :value-type directory)) + ;;; Git (defvar magit-git-debug nil @@ -1264,28 +1286,6 @@ or if no rename is detected." (setq pos (point))) status))) -(defcustom magit-cygwin-mount-points - (and (eq system-type 'windows-nt) - (cl-sort (mapcar - (lambda (mount) - (if (string-match "^\\(.*\\) on \\(.*\\) type" mount) - (cons (file-name-as-directory (match-str 2 mount)) - (file-name-as-directory (match-str 1 mount))) - (lwarn '(magit) :error - "Failed to parse Cygwin mount: %S" mount))) - ;; If --exec-path is not a native Windows path, - ;; then we probably have a cygwin git. - (and-let ((dirs (magit--early-process-lines - magit-git-executable "--exec-path"))) - (and (not (string-match-p "\\`[a-zA-Z]:" (car dirs))) - (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." - :package-version '(magit . "2.3.0") - :group 'magit-process - :type '(alist :key-type string :value-type directory)) - (defun magit-expand-git-file-name (filename) (unless (file-name-absolute-p filename) (setq filename (expand-file-name filename))) |
