Have browse-to-remote default to master in detached repos

Instead of producing links with nil branch.
This commit is contained in:
Henrik Lissner 2020-02-24 19:58:03 -05:00
parent 59b57b7eae
commit f55bcdfd30
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -71,3 +71,12 @@ otherwise in default state."
(when (and (bound-and-true-p evil-mode)
(bobp) (eolp))
(evil-insert-state)))))
;; HACK `browse-at-remote' produces urls with `nil' in them, when the repo
;; detached. This creates broken links. I think it is more sensible to at
;; least refer to master in those case.
(defadvice! +vc--fallback-to-master-branch-a ()
"Return 'master' in detached state."
:after-until #'browse-at-remote--get-local-branch
"master")