Function: magit-get-upstream-remote
magit-get-upstream-remote is a natively compiled function defined in
magit-git.el.
Signature
(magit-get-upstream-remote &optional BRANCH ALLOW-UNNAMED)
Source Code
;; Defined in /nix/store/irvbdy0zra0dn8fpd008f32x5ix6qm5v-emacs-packages-deps/share/emacs/site-lisp/elpa/magit-20261005.508/magit-git.el
(defun magit-get-upstream-remote (&optional branch allow-unnamed)
(and-let* ((branch (or branch (magit-get-current-branch)))
(remote (magit-get "branch" branch "remote")))
(and (not (equal remote "."))
(cond ((member remote (magit-list-remotes))
(magit--propertize-face remote 'magit-branch-remote))
((and allow-unnamed
(string-match-p "\\(\\`.\\{0,2\\}/\\|[:@]\\)" remote))
(magit--propertize-face remote 'bold))))))