Function: diff-hl-stage-diff

diff-hl-stage-diff is a natively compiled function defined in diff-hl.el.

Signature

(diff-hl-stage-diff ORIG-BUFFER)

Source Code

;; Defined in /nix/store/cfz56rl3lp066226i0bmmgiicls3gcq7-emacs-packages-deps/share/emacs/site-lisp/elpa/diff-hl-20261001.135/diff-hl.el
(defun diff-hl-stage-diff (orig-buffer)
  (let ((patchfile (make-nearby-temp-file "diff-hl-stage-patch"))
        success)
    (write-region (point-min) (point-max) patchfile
                  nil 'silent)
    (unwind-protect
        (with-current-buffer orig-buffer
          (with-output-to-string
            (vc-git-command standard-output 0
                            (file-local-name patchfile)
                            "apply" "--cached" )
            (setq success t)))
      (delete-file patchfile))
    success))