Function: magit--insert-related-refs

magit--insert-related-refs is a byte-compiled function defined in magit-diff.el.

Signature

(magit--insert-related-refs REV ARG TITLE REMOTE)

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-diff.el
(defun magit--insert-related-refs (rev arg title remote)
  (when-let ((refs (magit-list-related-branches arg rev (and remote "-a"))))
    (magit-insert-section (related-refs)
      (insert title ":" (make-string (- 10 (length title)) ?\s))
      (dolist (branch refs)
        (if (<= (+ (current-column) 1 (length branch))
                (window-width))
            (insert ?\s)
          (insert ?\n (make-string 12 ?\s)))
        (insert (propertize branch 'font-lock-face
                            (if (string-prefix-p "remotes/" branch)
                                'magit-branch-remote
                              'magit-branch-local))))
      (insert ?\n))))