Function: magit-ediff-read-files

magit-ediff-read-files is a byte-compiled function defined in magit-ediff.el.

Signature

(magit-ediff-read-files REVA REVB &optional FILEB)

Documentation

Read file in REVB, return it and the corresponding file in REVA.

When FILEB is non-nil, use this as REVB's file instead of prompting for it.

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-ediff.el
(defun magit-ediff-read-files (revA revB &optional fileB)
  "Read file in REVB, return it and the corresponding file in REVA.
When FILEB is non-nil, use this as REVB's file instead of
prompting for it."
  (when (equal revA "{worktree}") (setq revA nil))
  (when (equal revB "{worktree}") (setq revB nil))
  (unless (and fileB (member fileB (magit-revision-files revB)))
    (setq fileB
          (or (and fileB
                   magit-buffer-log-files
                   (derived-mode-p 'magit-log-mode)
                   (member "--follow" magit-buffer-log-args)
                   (cdr (assoc fileB
                               (magit-renamed-files
                                revB
                                (oref (car (oref magit-root-section children))
                                      value)))))
              (magit-read-file-choice
               (format "File to compare between %s and %s"
                       revA (or revB "the working tree"))
               (magit-changed-files revA revB)
               (format "No changed files between %s and %s"
                       revA (or revB "the working tree"))))))
  (list (or (car (member fileB (magit-revision-files revA)))
            (cdr (assoc fileB (magit-renamed-files revB revA)))
            (magit-read-file-choice
             (format "File in %s to compare with %s in %s"
                     revA fileB (or revB "the working tree"))
             (magit-changed-files revB revA)
             (format "No files have changed between %s and %s"
                     revA revB)))
        fileB))