From 6ceb1e0bbe681520d496837807961591660684fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ellis=20Keny=C5=91?= Date: Wed, 11 May 2022 10:14:32 +0100 Subject: [PATCH] fix(magit): only revert if buffer file exists --- modules/tools/magit/autoload.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tools/magit/autoload.el b/modules/tools/magit/autoload.el index e18c265f6..de76aab6f 100644 --- a/modules/tools/magit/autoload.el +++ b/modules/tools/magit/autoload.el @@ -86,7 +86,7 @@ window that already exists in that direction. It will split otherwise." (defun +magit--revert-buffer (buffer) (with-current-buffer buffer (kill-local-variable '+magit--stale-p) - (when buffer-file-name + (when (and buffer-file-name (file-exists-p buffer-file-name)) (if (buffer-modified-p (current-buffer)) (when (bound-and-true-p vc-mode) (vc-refresh-state)