fix(magit): only revert if buffer file exists

This commit is contained in:
Ellis Kenyő 2022-05-11 10:14:32 +01:00 committed by Henrik Lissner
parent f178eb6f52
commit 6ceb1e0bbe

View file

@ -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)