branch: elpa/git-commit commit b137e7d698f14a044c921c68a2bfbed21488c8cc Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
magit-save-repository-buffers: Fix saving of remote buffers - Actually compare the remote parts as intended. - Remove a redundant condition. Closes #4292. --- Documentation/RelNotes/3.4.0.org | 3 +++ lisp/magit-mode.el | 9 +++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/RelNotes/3.4.0.org b/Documentation/RelNotes/3.4.0.org index 825c1d5..36ee456 100644 --- a/Documentation/RelNotes/3.4.0.org +++ b/Documentation/RelNotes/3.4.0.org @@ -6,3 +6,6 @@ ~git-commit-setup-hook~. ** Fixes since v3.3.0 + +- Automatic saving of file-visiting buffers was broken inside remote + repositories that are accessed using Tramp. #4292 diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el index af64c05..3cd7bb2 100644 --- a/lisp/magit-mode.el +++ b/lisp/magit-mode.el @@ -1206,7 +1206,7 @@ buffer which visits a file in the current repository. Optional argument (the prefix) non-nil means save all with no questions." (interactive "P") (when-let ((topdir (magit-rev-parse-safe "--show-toplevel"))) - (let ((remote (file-remote-p topdir)) + (let ((remote (file-remote-p default-directory)) (save-some-buffers-action-alist `((?Y (lambda (buffer) (with-current-buffer buffer @@ -1223,15 +1223,12 @@ argument (the prefix) non-nil means save all with no questions." (and (not magit-inhibit-refresh-save) buffer-file-name ;; Avoid needlessly connecting to unrelated remotes. - (equal (file-remote-p buffer-file-name) - remote) + (equal (file-remote-p buffer-file-name) remote) ;; For remote files this makes network requests and ;; therefore has to come after the above to avoid ;; unnecessarily waiting for unrelated hosts. (file-exists-p (file-name-directory buffer-file-name)) - (string-prefix-p topdir (file-truename buffer-file-name)) - (equal (magit-rev-parse-safe "--show-toplevel") - topdir))))))) + (equal (magit-rev-parse-safe "--show-toplevel") topdir))))))) ;;; Restore Window Configuration