Function: treemacs--update-git-commit-diff

treemacs--update-git-commit-diff is a byte-compiled function defined in treemacs-git-commit-diff-mode.el.

Signature

(treemacs--update-git-commit-diff PROJECT &optional BUFFER)

Documentation

Update the commit diff for a single PROJECT.

Look for the PROJECT either in BUFFER or the local treemacs buffer.

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-git-commit-diff-mode.el
(defun treemacs--update-git-commit-diff (project &optional buffer)
  "Update the commit diff for a single PROJECT.
Look for the PROJECT either in BUFFER or the local treemacs buffer."
  (let ((path (treemacs-project->path project))
        (buffer (or buffer (treemacs-get-local-buffer))))
    (treemacs-with-path path
      :no-match-action
      (ignore)
      :file-action
      (pfuture-callback `(,treemacs-python-executable
                          "-O"
                          ,treemacs--git-commit-diff.py
                          ,treemacs-git-executable
                          ,path)
        :directory path
        :on-success
        (when (buffer-live-p buffer)
          (-let [out (-> (pfuture-callback-output)
                         (treemacs-string-trim-right)
                         (read))]
            (with-current-buffer buffer
              (if out
                  (treemacs-set-annotation-suffix path out treemacs--commit-diff-ann-source)
                (treemacs-remove-annotation-suffix path treemacs--commit-diff-ann-source))
              (treemacs-apply-single-annotation path))))))))