mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
fix(magit): +magit-auto-revert: handle edge cases
In cases where user have changed `vc-follow-symlinks`, causing *Messages* spam and unexpected prompting, OR where revert-buffer hooks and handlers are prematurely triggered for file buffers that haven't been changed. Fix: #8392
This commit is contained in:
@ -114,9 +114,12 @@ window that already exists in that direction. It will split otherwise."
|
|||||||
(kill-local-variable '+magit--stale-p)
|
(kill-local-variable '+magit--stale-p)
|
||||||
(when (magit-auto-revert-repository-buffer-p buffer)
|
(when (magit-auto-revert-repository-buffer-p buffer)
|
||||||
(save-restriction
|
(save-restriction
|
||||||
|
(cl-incf magit-auto-revert-counter)
|
||||||
(when (bound-and-true-p vc-mode)
|
(when (bound-and-true-p vc-mode)
|
||||||
(vc-refresh-state))
|
(let ((vc-follow-symlinks t))
|
||||||
(when (and buffer-file-name (not (buffer-modified-p buffer)))
|
(vc-refresh-state)))
|
||||||
|
(when (and (not (get-buffer-process buffer))
|
||||||
|
(funcall buffer-stale-function t))
|
||||||
(revert-buffer t t t))
|
(revert-buffer t t t))
|
||||||
(force-mode-line-update)))))
|
(force-mode-line-update)))))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user