Function: magit-apply-region

magit-apply-region is a byte-compiled function defined in magit-apply.el.

Signature

(magit-apply-region HUNK &rest ARGS)

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-apply.el
(defun magit-apply-region (hunk &rest args)
  (let ((file (oref hunk parent)))
    (when (magit-diff--combined-p file)
      (user-error "Cannot un-/stage resolution hunks.  Stage the whole file"))
    (magit-apply-patch
     file args
     (concat (magit-diff-file-header hunk)
             (magit-apply--adjust-hunk-new-start
              (magit-diff-hunk-region-patch hunk args))))))