mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -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)
|
||||
(when (magit-auto-revert-repository-buffer-p buffer)
|
||||
(save-restriction
|
||||
(cl-incf magit-auto-revert-counter)
|
||||
(when (bound-and-true-p vc-mode)
|
||||
(vc-refresh-state))
|
||||
(when (and buffer-file-name (not (buffer-modified-p buffer)))
|
||||
(let ((vc-follow-symlinks t))
|
||||
(vc-refresh-state)))
|
||||
(when (and (not (get-buffer-process buffer))
|
||||
(funcall buffer-stale-function t))
|
||||
(revert-buffer t t t))
|
||||
(force-mode-line-update)))))
|
||||
|
||||
|
Reference in New Issue
Block a user