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

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

[nongnu] elpa/git-commit 5bd6c15089: magit-save-repository-buffers: Guar


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit 5bd6c15089: magit-save-repository-buffers: Guard against disappeared repository
Date: Mon, 6 Mar 2023 14:59:28 -0500 (EST)

branch: elpa/git-commit
commit 5bd6c150897773038f95e95643c512e87ba615d8
Author: Nicholas Vollmer <iarchivedmywholelife@gmail.com>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    magit-save-repository-buffers: Guard against disappeared repository
    
    Ensure buffer's repository directory exists before trying to start
    subprocess with `default-directory' to it, which would fail.
---
 lisp/magit-mode.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index a13fb7c895..d4b7f18e35 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -1197,6 +1197,10 @@ argument (the prefix) non-nil means save all with no 
questions."
                   (let ((default-directory
                          (file-name-directory buffer-file-name)))
                     (and
+                     ;; - Check whether the repository still exists
+                     ;;   Necessary because  we call git inside of it.
+                     default-directory
+                     (file-exists-p default-directory)
                      ;; - Check whether refreshing is disabled.
                      (not magit-inhibit-refresh-save)
                      ;; - Check whether the visited file is either on the



reply via email to

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