fix(vc): browse-at-remote: adapt to vc-git--call

This commit is contained in:
Henrik Lissner
2025-09-29 17:11:44 -04:00
parent bc9618d744
commit 5e7e93beb9

View File

@@ -173,4 +173,20 @@ info in the `header-line-format' is a more visible indicator."
(defadvice! +vc--fallback-to-master-branch-a ()
"Return 'master' in detached state."
:after-until #'browse-at-remote--get-local-branch
"master"))
"master")
;; HACK: `vc-git--call's signature changed in 31+, breaking all uses of it in
;; `browse-at-remote'. This tides over the issue until it is addressed
;; upstream or we switch to git-link.
;; REVIEW: Address this upstream or switch to git-link!
(when (> emacs-major-version 30)
(defadvice! +vc--compat-31-a (fn &rest args)
:around #'browse-at-remote--get-local-branch
:around #'browse-at-remote--get-remote-url
:around #'browse-at-remote--get-remotes
:around #'browse-at-remote--get-from-config
(if (< 2 (car (subr-arity (symbol-function #'vc-git--call))))
(letf! (defun vc-git--call (first &rest args)
(apply vc-git--call nil first args))
(apply fn args))
(apply fn args)))))