Function: magit-read-other-branch-or-commit
magit-read-other-branch-or-commit is a natively compiled function
defined in magit-git.el.
Signature
(magit-read-other-branch-or-commit PROMPT &optional EXCLUDE SECONDARY-DEFAULT)
Source Code
;; Defined in /nix/store/irvbdy0zra0dn8fpd008f32x5ix6qm5v-emacs-packages-deps/share/emacs/site-lisp/elpa/magit-20261005.508/magit-git.el
(defun magit-read-other-branch-or-commit
(prompt &optional exclude secondary-default)
(let* ((current (magit-get-current-branch))
(atpoint (magit-branch-or-commit-at-point))
(exclude (or exclude current))
(default (or (and (not (equal atpoint exclude))
(not (and (not current)
(magit-rev-equal atpoint "HEAD")))
atpoint)
(and (not (equal current exclude)) current)
secondary-default
(magit-get-previous-branch))))
(minibuffer-with-setup-hook #'magit--minibuf-default-add-commit
(magit-completing-read prompt (delete exclude (magit-list-refnames))
nil 'any nil 'magit-revision-history default))))