branch: elpa/git-commit commit 8102e8bf2bec80cde2178471f3eb33637a262399 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
magit-file-accessible-directory-p: Remove kludge function This was necessary to work around a bug in macOS. It has been nine years since then, and Yamamoto Mitsuharu reported on bug#21573 that he can no longer reproduce and "presumably Apple have fixed it". Re #2295. --- lisp/magit-base.el | 7 ------- lisp/magit-diff.el | 2 +- lisp/magit-git.el | 2 +- lisp/magit-repos.el | 2 +- lisp/magit-submodule.el | 2 +- 5 files changed, 4 insertions(+), 11 deletions(-) diff --git a/lisp/magit-base.el b/lisp/magit-base.el index d57bf885e2..46b69b8352 100644 --- a/lisp/magit-base.el +++ b/lisp/magit-base.el @@ -1015,13 +1015,6 @@ This function should be named `version>=' and be part of Emacs." ;;; Kludges for Emacs Bugs -(defun magit-file-accessible-directory-p (filename) - "Like `file-accessible-directory-p' but work around an Apple bug. -See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21573#17 -and https://github.com/magit/magit/issues/2295." - (and (file-directory-p filename) - (file-accessible-directory-p filename))) - (when (< emacs-major-version 27) ;; Work around https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21559. ;; Fixed by cb55ccae8be946f1562d74718086a4c8c8308ee5 in Emacs 27.1. diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el index 586f9a6bad..a64d4d6e43 100644 --- a/lisp/magit-diff.el +++ b/lisp/magit-diff.el @@ -1643,7 +1643,7 @@ Like `magit-diff-visit-worktree-file' but use If FORCE-WORKTREE is non-nil, then visit the worktree version of the file, even if the diff is about a committed change. Use FN to display the buffer in some window." - (if (magit-file-accessible-directory-p file) + (if (file-accessible-directory-p file) (magit-diff-visit-directory file force-worktree) (pcase-let ((`(,buf ,pos) (magit-diff-visit-file--noselect file force-worktree))) diff --git a/lisp/magit-git.el b/lisp/magit-git.el index f15cf3ff68..a080b898fd 100644 --- a/lisp/magit-git.el +++ b/lisp/magit-git.el @@ -821,7 +821,7 @@ Also see `magit-git-config-p'." (let ((dir (file-name-as-directory (expand-file-name (or file default-directory)))) (previous nil)) - (while (not (magit-file-accessible-directory-p dir)) + (while (not (file-accessible-directory-p dir)) (setq dir (file-name-directory (directory-file-name dir))) (when (equal dir previous) (throw 'unsafe-default-dir nil)) diff --git a/lisp/magit-repos.el b/lisp/magit-repos.el index fe231cbb24..769f29aa4d 100644 --- a/lisp/magit-repos.el +++ b/lisp/magit-repos.el @@ -505,7 +505,7 @@ instead." (defun magit-list-repos-1 (directory depth) (cond ((file-readable-p (expand-file-name ".git" directory)) (list (file-name-as-directory directory))) - ((and (> depth 0) (magit-file-accessible-directory-p directory)) + ((and (> depth 0) (file-accessible-directory-p directory)) (--mapcat (and (file-directory-p it) (magit-list-repos-1 it (1- depth))) (directory-files directory t diff --git a/lisp/magit-submodule.el b/lisp/magit-submodule.el index c4c60ef487..96b4466cb6 100644 --- a/lisp/magit-submodule.el +++ b/lisp/magit-submodule.el @@ -604,7 +604,7 @@ These sections can be expanded to show the respective commits." (when (magit-module-worktree-p module) (let ((default-directory (expand-file-name (file-name-as-directory module)))) - (when (magit-file-accessible-directory-p default-directory) + (when (file-accessible-directory-p default-directory) (magit-insert-section sec (module module t) (magit-insert-heading (propertize module