branch: elpa/magit
commit 61c051ea1cda5fe6c9404cb5ae228088d2e254f0
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
magit-auto-revert-mode: Respect auto-revert-remote-files up front
This has the advantage that it avoids unnecessary work when connecting
to a remote and when later opening additional remote files, when this
is disabled, which it is by default.
The disadvantage is that this is inconsistent with the behavior of
`global-auto-revert-mode', which enables the local mode for buffers
visiting remote files regardless of the value of this variable, and
leaving it to `auto-revert-handler' to possibly forgo the process of
reverting buffers.
Closes #5222.
Closes #5223.
---
lisp/magit-autorevert.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lisp/magit-autorevert.el b/lisp/magit-autorevert.el
index 5fc3b272b5a..5a38d9f6797 100644
--- a/lisp/magit-autorevert.el
+++ b/lisp/magit-autorevert.el
@@ -105,6 +105,8 @@ seconds of user inactivity. That is not desirable."
((and (not auto-revert-mode) ; see #3014
(not global-auto-revert-mode) ; see #3460
buffer-file-name
+ (or auto-revert-remote-files ; see #5422
+ (not (file-remote-p buffer-file-name)))
(file-readable-p buffer-file-name)
(compat-call executable-find (magit-git-executable) t)
(magit-toplevel)