Function: magit-rev-name
magit-rev-name is a byte-compiled function defined in magit-git.el.
Signature
(magit-rev-name REV &optional PATTERN NOT-ANCHORED)
Documentation
Return a symbolic name for REV using git-name-rev.
PATTERN can be used to limit the result to a matching ref. Unless NOT-ANCHORED is non-nil, the beginning of the ref must match PATTERN. An anchored lookup is done using the arguments "--exclude=*/<PATTERN>" and "--exclude=*/HEAD", in addition to "--refs=<PATTERN>".
Source Code
;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-git.el
(defun magit-rev-name (rev &optional pattern not-anchored)
"Return a symbolic name for REV using `git-name-rev'.
PATTERN can be used to limit the result to a matching ref. Unless
NOT-ANCHORED is non-nil, the beginning of the ref must match PATTERN.
An anchored lookup is done using the arguments \"--exclude=*/<PATTERN>\"
and \"--exclude=*/HEAD\", in addition to \"--refs=<PATTERN>\"."
(magit-git-string "name-rev" "--name-only" "--no-undefined"
(and pattern (concat "--refs=" pattern))
(and pattern
(not not-anchored)
(list "--exclude=*/HEAD"
(concat "--exclude=*/" pattern)))
rev))