Function: magit-read-stash
magit-read-stash is a natively compiled function defined in
magit-git.el.
Signature
(magit-read-stash PROMPT)
Source Code
;; Defined in /nix/store/irvbdy0zra0dn8fpd008f32x5ix6qm5v-emacs-packages-deps/share/emacs/site-lisp/elpa/magit-20261005.508/magit-git.el
(defun magit-read-stash (prompt)
(let* ((atpoint (magit-stash-at-point))
(default (and atpoint
(concat atpoint (magit-rev-format " %s" atpoint))))
(choices (mapcar (lambda (c)
(pcase-let ((`(,rev ,msg) (split-string c "\0")))
(concat (propertize rev 'face 'magit-hash)
" " msg)))
(magit-list-stashes "%gd%x00%s")))
(choice (magit-completing-read prompt choices
nil t nil nil
default
(car choices))))
(and choice
(string-match "^\\([^ ]+\\) \\(.+\\)" choice)
(substring-no-properties (match-str 1 choice)))))