Function: majutsu-read-remote-name
majutsu-read-remote-name is a natively compiled function defined in
majutsu-remote.el.
Signature
(majutsu-read-remote-name PROMPT &optional REQUIRE-MATCH DEFAULT)
Documentation
Read a Git remote name with PROMPT.
If REQUIRE-MATCH is non-nil, require an existing remote name. DEFAULT is preselected when non-nil; otherwise the remote section at point is used.
Source Code
;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-remote.el
(defun majutsu-read-remote-name (prompt &optional require-match default)
"Read a Git remote name with PROMPT.
If REQUIRE-MATCH is non-nil, require an existing remote name. DEFAULT
is preselected when non-nil; otherwise the remote section at point is used."
(let* ((root (ignore-errors (majutsu--toplevel-safe)))
(payload (majutsu-remote-candidate-data root))
(candidates (plist-get payload :candidates))
(default (or default (majutsu-remote-at-point))))
(cond
(candidates)
(require-match
(user-error "No Git remotes"))
(t
(setq payload (plist-put payload :candidates '("origin")))))
(majutsu-completing-read-payload prompt payload
nil (or require-match 'any) nil
'majutsu-remote-name-history
default 'majutsu-remote nil
(or root default-directory))))