Function: magit-sparse-checkout-insert-header

magit-sparse-checkout-insert-header is a byte-compiled function defined in magit-sparse-checkout.el.

Signature

(magit-sparse-checkout-insert-header)

Documentation

Insert header line with sparse checkout information.

This header is not inserted by default. To enable it, add it to magit-status-headers-hook.

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-sparse-checkout.el
;;; Miscellaneous

(defun magit-sparse-checkout-insert-header ()
  "Insert header line with sparse checkout information.
This header is not inserted by default.  To enable it, add it to
`magit-status-headers-hook'."
  (when (magit-sparse-checkout-enabled-p)
    (insert (propertize (format "%-10s" "Sparse! ")
                        'font-lock-face 'magit-section-heading))
    (insert
     (let ((dirs (magit-sparse-checkout-directories)))
       (pcase (length dirs)
         (0 "top-level directory")
         (1 (car dirs))
         (n (format "%d directories" n)))))
    (insert ?\n)))