Function: magit-apply-hunks

magit-apply-hunks is a natively compiled function defined in magit-apply.el.

Signature

(magit-apply-hunks HUNKS &rest ARGS)

Source Code

;; Defined in /nix/store/irvbdy0zra0dn8fpd008f32x5ix6qm5v-emacs-packages-deps/share/emacs/site-lisp/elpa/magit-20261005.508/magit-apply.el
(defun magit-apply-hunks (hunks &rest args)
  (let ((file (oref (car hunks) parent)))
    (when (magit-diff--combined-p file)
      (user-error "Cannot un-/stage resolution hunks.  Stage the whole file"))
    (magit-apply-patch
     file args
     (concat (oref file header)
             (string-join (magit-apply--adjust-hunk-new-starts
                           (mapcar #'magit-apply--section-content hunks)))))))