[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/git-commit 09333d6 3/8: magit-save-repository-buffers: Rea
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/git-commit 09333d6 3/8: magit-save-repository-buffers: Rearrange and improve comments |
Date: |
Tue, 12 Oct 2021 14:57:47 -0400 (EDT) |
branch: elpa/git-commit
commit 09333d63a28d476cb036edd588013ac37b2484ac
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
magit-save-repository-buffers: Rearrange and improve comments
---
lisp/magit-mode.el | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index 9a4585c..59b8fd0 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -1220,15 +1220,19 @@ argument (the prefix) non-nil means save all with no
questions."
,@save-some-buffers-action-alist)))
(save-some-buffers
arg (lambda ()
- (and (not magit-inhibit-refresh-save)
- buffer-file-name
- ;; Avoid needlessly connecting to unrelated remotes.
+ (and buffer-file-name
+ ;; - Check whether refreshing is disabled.
+ (not magit-inhibit-refresh-save)
+ ;; - Check whether the visited file is either on the
+ ;; same remote as the repository, or both are on
+ ;; the local system.
(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-writable-p buffer-file-name)
- (equal (magit-rev-parse-safe "--show-toplevel") topdir)))))))
+ ;; Delayed checks that are more expensive for remote
+ ;; repositories, due to the required network access.
+ ;; - Check whether the file is inside the repository.
+ (equal (magit-rev-parse-safe "--show-toplevel") topdir)
+ ;; - Check whether the file is actually writable.
+ (file-writable-p buffer-file-name)))))))
;;; Restore Window Configuration
- [nongnu] elpa/git-commit updated (cabcc9c -> 348d9b9), ELPA Syncer, 2021/10/12
- [nongnu] elpa/git-commit b137e7d 1/8: magit-save-repository-buffers: Fix saving of remote buffers, ELPA Syncer, 2021/10/12
- [nongnu] elpa/git-commit ba9caff 2/8: magit-save-repository-buffers: Assert file is writable, ELPA Syncer, 2021/10/12
- [nongnu] elpa/git-commit 7aa314c 4/8: Fix worktree commands when using tramp, ELPA Syncer, 2021/10/12
- [nongnu] elpa/git-commit 197f51f 5/8: magit-list-worktree: Make sure all paths are worktrees, ELPA Syncer, 2021/10/12
- [nongnu] elpa/git-commit 0b9927d 7/8: magit-section: Fix :package-version of options, ELPA Syncer, 2021/10/12
- [nongnu] elpa/git-commit 09333d6 3/8: magit-save-repository-buffers: Rearrange and improve comments,
ELPA Syncer <=
- [nongnu] elpa/git-commit 7a94132 6/8: Rename magit-keep-region-overlay to magit-section-keep-region-overlay, ELPA Syncer, 2021/10/12
- [nongnu] elpa/git-commit 348d9b9 8/8: magit-section: Fix immediate selection highlighting, ELPA Syncer, 2021/10/12