From 5e7e93beb9f2b5a81768aaf4950203ceea21c4f6 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 29 Sep 2025 17:11:44 -0400 Subject: [PATCH] fix(vc): browse-at-remote: adapt to vc-git--call --- modules/emacs/vc/config.el | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/modules/emacs/vc/config.el b/modules/emacs/vc/config.el index 2e2e9e670..3414c462b 100644 --- a/modules/emacs/vc/config.el +++ b/modules/emacs/vc/config.el @@ -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)))))