aboutsummaryrefslogtreecommitdiff
path: root/lisp/magit-git.el
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2026-01-09 15:19:43 +0100
committerJonas Bernoulli <jonas@bernoul.li>2026-01-09 15:19:43 +0100
commitb2a2794507ec307a7bca2905ce6343f288b5ce55 (patch)
tree474314199ce6eb1b26311760395b802dafaf0be0 /lisp/magit-git.el
parent6950f72d86bef9c51f98addbbe75da24f7e49329 (diff)
magit-get-@{push}-branch: Improve verification
Continue to return the resolved but abbreviated refname, or nil if the remote tracking branch does not exist. However, no longer assume that the full ref begins with "refs/remotes/".
Diffstat (limited to 'lisp/magit-git.el')
-rw-r--r--lisp/magit-git.el6
1 files changed, 2 insertions, 4 deletions
diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index a79c530..023b485 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -1884,10 +1884,8 @@ according to the branch type."
(defun magit-get-@{push}-branch (&optional branch)
(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)))
+ (target (magit-ref-fullname (concat branch "@{push}"))))
+ (magit-ref-abbrev target)))
(defun magit-get-remote (&optional branch)
(and (or branch (setq branch (magit-get-current-branch)))