Function: magit-diff-file-header

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

Signature

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

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/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)))))