Function: magit-after-save-refresh-status

magit-after-save-refresh-status is a byte-compiled function defined in magit-mode.el.

Signature

(magit-after-save-refresh-status)

Documentation

Refresh the status buffer of the current repository.

This function is intended to be added to after-save-hook.

If the status buffer does not exist or the file being visited in the current buffer isn't inside the working tree of a repository, then do nothing.

Note that refreshing a Magit buffer is done by re-creating its contents from scratch, which can be slow in large repositories. If you are not satisfied with Magit's performance, then you should obviously not add this function to that hook.

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-mode.el
(defun magit-after-save-refresh-status ()
  "Refresh the status buffer of the current repository.

This function is intended to be added to `after-save-hook'.

If the status buffer does not exist or the file being visited in
the current buffer isn't inside the working tree of a repository,
then do nothing.

Note that refreshing a Magit buffer is done by re-creating its
contents from scratch, which can be slow in large repositories.
If you are not satisfied with Magit's performance, then you
should obviously not add this function to that hook."
  (when-let ((_(not magit-inhibit-refresh))
             (_(magit-inside-worktree-p t))
             (buf (ignore-errors (magit-get-mode-buffer 'magit-status-mode))))
    (cl-pushnew buf magit-after-save-refresh-buffers)
    (add-hook 'post-command-hook #'magit-after-save-refresh-buffers)))