branch: elpa/magit
commit efaf91d8af17a99ec0c5d6ae8c151ba6319fa2f1
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    magit-find-file-noselect: Auto-revert worktree file
    
    If `auto-revert-mode' is enabled but hasn't gotten around to reverting
    the file yet, arrange for `find-file-noselect' to automatically revert
    it now, without prompting.
---
 lisp/magit-files.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/magit-files.el b/lisp/magit-files.el
index 67b88005779..ec6648ea7e9 100644
--- a/lisp/magit-files.el
+++ b/lisp/magit-files.el
@@ -117,7 +117,8 @@ A non-nil value for REVERT is ignored if REV is 
\"{worktree}\"."
          (defdir   (file-name-directory file-abs))
          (rev      (magit--abbrev-if-hash rev)))
     (if (equal rev "{worktree}")
-        (find-file-noselect file-abs)
+        (let ((revert-without-query (and auto-revert-mode '("."))))
+          (find-file-noselect file-abs))
       (with-current-buffer (magit-get-revision-buffer-create rev file-rel)
         (when (or (not magit-buffer-file-name)
                   (if (eq revert 'ask-revert)

Reply via email to