Function: magit-repolist--mapc

magit-repolist--mapc is a byte-compiled function defined in magit-repos.el.

Signature

(magit-repolist--mapc FN REPOS &optional MSG)

Documentation

Apply FN to each directory in REPOS for side effects only.

If REPOS is the symbol all, then call FN for all displayed repositories. When FN is called, default-directory is bound to the top-level directory of the current repository. If optional MSG is non-nil then that is displayed around each call to FN. If it contains "%s" then the directory is substituted for that.

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-repos.el
(defun magit-repolist--mapc (fn repos &optional msg)
  "Apply FN to each directory in REPOS for side effects only.
If REPOS is the symbol `all', then call FN for all displayed
repositories.  When FN is called, `default-directory' is bound to
the top-level directory of the current repository.  If optional
MSG is non-nil then that is displayed around each call to FN.
If it contains \"%s\" then the directory is substituted for that."
  (when (eq repos 'all)
    (setq repos nil)
    (save-excursion
      (goto-char (point-min))
      (while (not (eobp))
        (push (tabulated-list-get-id) repos)
        (forward-line)))
    (setq repos (nreverse repos)))
  (let ((base default-directory)
        (len (length repos))
        (i 0))
    (dolist (repo repos)
      (let ((default-directory
             (file-name-as-directory (expand-file-name repo base))))
        (if msg
            (let ((msg (concat (format "(%s/%s) " (cl-incf i) len)
                               (format msg default-directory))))
              (message msg)
              (funcall fn)
              (message (concat msg "done")))
          (funcall fn))))))