diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2026-01-09 15:19:42 +0100 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2026-01-09 15:19:42 +0100 |
| commit | 6950f72d86bef9c51f98addbbe75da24f7e49329 (patch) | |
| tree | d2dee7f60fbaf6ada55e7ab1ca769e01f5d01104 /lisp/magit-git.el | |
| parent | 31496bc03e3089debaa95bfd06695c4f244dc358 (diff) | |
magit-get-@{push}-branch: Support full ref as argument
Diffstat (limited to 'lisp/magit-git.el')
| -rw-r--r-- | lisp/magit-git.el | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lisp/magit-git.el b/lisp/magit-git.el index eaa132a..a79c530 100644 --- a/lisp/magit-git.el +++ b/lisp/magit-git.el @@ -1883,11 +1883,11 @@ according to the branch type." (magit--propertize-face target 'magit-branch-remote))))) (defun magit-get-@{push}-branch (&optional branch) - (let ((ref (magit-rev-parse "--symbolic-full-name" - (concat branch "@{push}")))) - (and ref - (string-prefix-p "refs/remotes/" ref) - (substring ref 13)))) + (and-let* ((branch (magit-ref-abbrev (or branch (magit-get-current-branch)))) + (target (magit-rev-parse "--symbolic-full-name" + (concat branch "@{push}"))) + (_(string-prefix-p "refs/remotes/" target))) + (substring target 13))) (defun magit-get-remote (&optional branch) (and (or branch (setq branch (magit-get-current-branch))) |
