branch: elpa/git-commit
commit bb7b7a402025e26aabc0aee6e97c2ee852a806a9
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    No longer depend on dash
---
 lisp/git-commit.el | 43 +++++++++++++++++++++++--------------------
 1 file changed, 23 insertions(+), 20 deletions(-)

diff --git a/lisp/git-commit.el b/lisp/git-commit.el
index a9de166..13bfef1 100644
--- a/lisp/git-commit.el
+++ b/lisp/git-commit.el
@@ -13,7 +13,7 @@
 
 ;; Keywords: git tools vc
 ;; Homepage: https://github.com/magit/magit
-;; Package-Requires: ((emacs "25.1") (dash "2.19.1") (transient "0.3.6") 
(with-editor "3.0.5"))
+;; Package-Requires: ((emacs "25.1") (transient "0.3.6") (with-editor "3.0.5"))
 ;; Package-Version: 3.3.0
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 
@@ -112,7 +112,7 @@
 ;;; Code:
 ;;;; Dependencies
 
-(require 'dash)
+(require 'seq)
 (require 'subr-x)
 
 (require 'magit-git nil t)
@@ -305,7 +305,7 @@ already using it, then you probably shouldn't start doing 
so."
     "Co-authored-by")
   "A list of Git pseudo headers to be highlighted."
   :group 'git-commit
-  :safe (lambda (val) (and (listp val) (-all-p 'stringp val)))
+  :safe (lambda (val) (and (listp val) (seq-every-p #'stringp val)))
   :type '(repeat string))
 
 (defcustom git-commit-use-local-message-ring nil
@@ -477,24 +477,27 @@ This is only used if Magit is available."
 (defun git-commit-file-not-found ()
   ;; cygwin git will pass a cygwin path (/cygdrive/c/foo/.git/...),
   ;; try to handle this in window-nt Emacs.
-  (--when-let
-      (and (or (string-match-p git-commit-filename-regexp buffer-file-name)
-               (and (boundp 'git-rebase-filename-regexp)
-                    (string-match-p git-rebase-filename-regexp
-                                    buffer-file-name)))
-           (not (file-accessible-directory-p
-                 (file-name-directory buffer-file-name)))
-           (if (require 'magit-git nil t)
-               ;; Emacs prepends a "c:".
-               (magit-expand-git-file-name (substring buffer-file-name 2))
-             ;; Fallback if we can't load `magit-git'.
-             (and (string-match 
"\\`[a-z]:/\\(cygdrive/\\)?\\([a-z]\\)/\\(.*\\)"
-                                buffer-file-name)
-                  (concat (match-string 2 buffer-file-name) ":/"
-                          (match-string 3 buffer-file-name)))))
-    (when (file-accessible-directory-p (file-name-directory it))
+  (when-let
+      ((file (and (or (string-match-p git-commit-filename-regexp
+                                      buffer-file-name)
+                      (and (boundp 'git-rebase-filename-regexp)
+                           (string-match-p git-rebase-filename-regexp
+                                           buffer-file-name)))
+                  (not (file-accessible-directory-p
+                        (file-name-directory buffer-file-name)))
+                  (if (require 'magit-git nil t)
+                      ;; Emacs prepends a "c:".
+                      (magit-expand-git-file-name
+                       (substring buffer-file-name 2))
+                    ;; Fallback if we can't load `magit-git'.
+                    (and (string-match
+                          "\\`[a-z]:/\\(cygdrive/\\)?\\([a-z]\\)/\\(.*\\)"
+                          buffer-file-name)
+                         (concat (match-string 2 buffer-file-name) ":/"
+                                 (match-string 3 buffer-file-name)))))))
+    (when (file-accessible-directory-p (file-name-directory file))
       (let ((inhibit-read-only t))
-        (insert-file-contents it t)
+        (insert-file-contents file t)
         t))))
 
 (when (eq system-type 'windows-nt)

Reply via email to