Function: magit-process-finish

magit-process-finish is a byte-compiled function defined in magit-process.el.

Signature

(magit-process-finish ARG &optional PROCESS-BUF COMMAND-BUF DEFAULT-DIR SECTION)

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-process.el
(defun magit-process-finish (arg &optional process-buf _command-buf
                                 default-dir section)
  (unless (integerp arg)
    (setq process-buf (process-buffer arg))
    (setq default-dir (process-get arg 'default-dir))
    (setq section     (process-get arg 'section))
    (setq arg         (process-exit-status arg)))
  (when (fboundp 'dired-uncache)
    (dired-uncache default-dir))
  (when (buffer-live-p process-buf)
    (with-current-buffer process-buf
      (magit-process-finish-section section arg)))
  (if (= arg 0)
      (magit-process-unset-mode-line default-dir)
    (let ((msg (magit-process-error-summary process-buf section)))
      (if magit-process-display-mode-line-error
          (magit-process-set-mode-line-error-status
           (or (magit-process-error-tooltip process-buf section) msg))
        (magit-process-unset-mode-line default-dir))
      (when (buffer-live-p process-buf)
        (with-current-buffer process-buf
          (when-let ((status-buf (magit-get-mode-buffer 'magit-status-mode)))
            (with-current-buffer status-buf
              (setq magit-this-error msg)))))
      (let ((usage
             (and magit-show-process-buffer-hint
                  (if-let ((keys (where-is-internal 'magit-process-buffer)))
                      (format "Type %s to see %S for details"
                              (key-description (car keys)) process-buf)
                    (format "See %S for details" process-buf)))))
        (if magit-process-raise-error
            (signal 'magit-git-error
                    (list msg (or usage (list 'in default-dir))))
          (message "Git error: %s"
                   (concat msg (and usage (format " [%s]" usage))))))))
  arg)