emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/git-commit 4d59e1cafd 5/9: magit-zap-caches: Also zap magi


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit 4d59e1cafd 5/9: magit-zap-caches: Also zap magit--remotes-using-recent-git
Date: Tue, 22 Feb 2022 05:58:10 -0500 (EST)

branch: elpa/git-commit
commit 4d59e1cafdc3b45033bc6dcd5f2f713ba01a676a
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    magit-zap-caches: Also zap magit--remotes-using-recent-git
---
 lisp/magit-git.el    |  4 ++++
 lisp/magit-mode.el   | 13 +++++++++----
 lisp/magit-status.el |  2 --
 3 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index d72b854d5e..05df0a35b5 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -574,6 +574,10 @@ call function WASHER with ARGS as its sole argument."
         (magit-cancel-section))
       (magit-maybe-make-margin-overlay))))
 
+;;; Git Version
+
+(defvar magit--remotes-using-recent-git nil)
+
 (defun magit-git-version (&optional raw)
   "Return the installed Git version."
   (--when-let (let (magit-git-global-arguments)
diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index 5d8764c59a..12cf4bb3b8 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -1424,15 +1424,17 @@ Unless specified, REPOSITORY is the current buffer's 
repository."
 (defun magit-zap-caches (&optional all)
   "Zap caches for the current repository.
 
-Remove the repository's entry from `magit-repository-local-cache'
-and set `magit-section-visibility-cache' to nil in all of the
-repository's Magit buffers.
+Remove the repository's entry from `magit-repository-local-cache',
+remove the host's entry from `magit--remotes-using-recent-git', set
+`magit-section-visibility-cache' to nil for all Magit buffers of
+the repository and set `magit--libgit-available-p' to `unknown'.
 
 With a prefix argument or if optional ALL is non-nil, discard the
 mentioned caches completely."
   (interactive)
   (cond (all
          (setq magit-repository-local-cache nil)
+         (setq magit--remotes-using-recent-git nil)
          (dolist (buffer (buffer-list))
            (with-current-buffer buffer
              (when (derived-mode-p 'magit-mode)
@@ -1442,7 +1444,10 @@ mentioned caches completely."
            (setq magit-repository-local-cache
                  (cl-delete default-directory
                             magit-repository-local-cache
-                            :key #'car :test #'equal)))
+                            :key #'car :test #'equal))
+           (setq magit--remotes-using-recent-git
+                 (delete (file-remote-p default-directory)
+                         magit--remotes-using-recent-git)))
          (dolist (buffer (magit-mode-get-buffers))
            (with-current-buffer buffer
              (setq magit-section-visibility-cache nil)))))
diff --git a/lisp/magit-status.el b/lisp/magit-status.el
index 07815f1d3f..589207166d 100644
--- a/lisp/magit-status.el
+++ b/lisp/magit-status.el
@@ -333,8 +333,6 @@ init file: (global-set-key (kbd \"C-x g\") 
'magit-status-quick)."
       (magit-display-buffer buffer)
     (call-interactively #'magit-status)))
 
-(defvar magit--remotes-using-recent-git nil)
-
 (defun magit--tramp-asserts (directory)
   (when-let ((remote (file-remote-p directory)))
     (unless (member remote magit--remotes-using-recent-git)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]