Skip to content

Commit

Permalink
magit-revert-buffers: don't use auto-revert-handler
Browse files Browse the repository at this point in the history
`auto-revert-handler' does quite a few things we don't need, so instead
of using that just call `revert-buffer', `vc-find-file-hook' directly.

Backport of edf2b42.
  • Loading branch information
tarsius committed Oct 10, 2014
1 parent 4a8bcef commit 68af16a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions magit.el
Expand Up @@ -4081,12 +4081,14 @@ the current repository."
(dolist (buf (buffer-list))
(with-current-buffer buf
(let ((file (buffer-file-name)))
(and file (string-prefix-p topdir file)
(not (string-prefix-p gitdir file))
(member (file-relative-name file topdir) tracked)
(let ((auto-revert-mode t))
(auto-revert-handler)
(run-hooks 'magit-revert-buffer-hook))))))))))
(when (and file (string-prefix-p topdir file)
(not (string-prefix-p gitdir file))
(member (file-relative-name file topdir) tracked)
(file-readable-p file)
(not (verify-visited-file-modtime buf)))
(revert-buffer 'ignore-auto 'dont-ask 'preserve-modes)
(vc-find-file-hook)
(run-hooks 'magit-revert-buffer-hook)))))))))

;;; (misplaced)
;;;; Diff Options
Expand Down

0 comments on commit 68af16a

Please sign in to comment.