Function: magit-diff-file-header

magit-diff-file-header is a natively compiled function defined in magit-diff.el.

Signature

(magit-diff-file-header SECTION &optional NO-RENAME)

Source Code

;; Defined in /nix/store/irvbdy0zra0dn8fpd008f32x5ix6qm5v-emacs-packages-deps/share/emacs/site-lisp/elpa/magit-20261005.508/magit-diff.el
;;; Diff Extract

(defun magit-diff-file-header (section &optional no-rename)
  (when (magit-hunk-section-p section)
    (setq section (oref section parent)))
  (and (magit-file-section-p section)
       (let ((header (oref section header)))
         (if (or (not no-rename)
                 (string-match-p "^--- /dev/null" header))
             header
           (replace-regexp-in-string
            "^--- \\(.+\\)" (oref section value) header t t 1)))))