The problem is that ultimately tramp-sh-handle-file-truename
is called which needs to make remote connections.
(Previously Tramp also tries to handle file-in-directory-p
itself but since it eventually figures out that it does not implement a
handler for that function and just falls back to the vanilla file-in-directory-p
, that doesn't cause any remote connections. Except that file-in-directory-p
does call file-truename
and that, as stated earlier, does make remote connections.)
This patch was applied (will be part of v2.3.1) to fix this issue:
diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index 271cc5f..d187cf5 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -833,6 +833,8 @@ (defun magit-revert-buffers (&optional force)
(--filter
(let ((file (buffer-file-name it)))
(and file
+ (equal (file-remote-p file)
+ (file-remote-p topdir))
(file-in-directory-p file topdir)
(member (file-relative-name file topdir) tracked)))
(buffer-list))
This checks whether the file
(each file which is being visited in some buffer in turn) and the directory/repository topdir
are located on the same remote (nil
for the local machine) before checking whether the file is located
inside that directory. Obviously a file cannot possibly be located
inside a directory which isn't even located on the same machine, so in
that case we can bail before performing the more expensive check.