branch: elpa/git-commit
commit ddeaa2d69aac4c89e95ab60cf216c4c389db1a02
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
magit-repository-local-delete: Support acting on all repositories
---
lisp/magit-mode.el | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index 0f8152690a..11d93cab0c 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -1348,11 +1348,16 @@ Unless specified, REPOSITORY is the current buffer's
repository."
(defun magit-repository-local-delete (key &optional repository)
"Delete the repository-local value for KEY.
-Unless specified, REPOSITORY is the current buffer's repository."
- (when-let ((cache (assoc (or repository
- (magit-repository-local-repository))
- magit-repository-local-cache)))
- (setf cache (compat-call assoc-delete-all key cache))))
+Unless specified, REPOSITORY is the current buffer's repository.
+If REPOSITORY is `all', then delete the value for KEY for all
+repositories."
+ (if (eq repository 'all)
+ (dolist (cache magit-repository-local-cache)
+ (setf cache (compat-call assoc-delete-all key cache)))
+ (when-let ((cache (assoc (or repository
+ (magit-repository-local-repository))
+ magit-repository-local-cache)))
+ (setf cache (compat-call assoc-delete-all key cache)))))
(defmacro magit--with-repository-local-cache (key &rest body)
(declare (indent 1) (debug (form body)))