branch: elpa/magit
commit 999047889ce39ba2dc3aa1e13f52fcc9a575f90b
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>

    magit--blob-normal-mode: Run magit-find-blob-hook
    
    I.e., run both when first finding the file and when reverting,
    as is done for regular files too (see `after-find-file').
---
 lisp/magit-files.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/magit-files.el b/lisp/magit-files.el
index 3900441b9d1..35be9819966 100644
--- a/lisp/magit-files.el
+++ b/lisp/magit-files.el
@@ -139,7 +139,6 @@ REV is a revision or one of \"{worktree}\" or \"{index}\"."
        (setq default-directory (if (file-exists-p defdir) defdir topdir))
        (setq-local revert-buffer-function #'magit--revert-blob-buffer)
        (revert-buffer t t)
-       (run-hooks 'magit-find-blob-hook)
        (current-buffer)))
     ((error "%s isn't inside a Git repository" file))))
 
@@ -172,7 +171,8 @@ REV is a revision or one of \"{worktree}\" or \"{index}\"."
     ;; so we have to use this strange invocation to achieve that.
     (normal-mode (not enable-local-variables))
     (setq buffer-read-only t)
-    (set-buffer-modified-p nil)))
+    (set-buffer-modified-p nil)
+    (run-hooks 'magit-find-blob-hook)))
 
 (define-advice lsp (:around (fn &rest args) magit-find-file)
   "Do nothing when visiting blob using `magit-find-file' and similar.

Reply via email to