Fix vcs/git-browse* commands #616
Caused by upstream changes to git-link, where `git-link--remote-host' was removed.
This commit is contained in:
parent
80fe6aa082
commit
dc86b61704
1 changed files with 14 additions and 11 deletions
|
@ -2,13 +2,12 @@
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +vcs-root ()
|
(defun +vcs-root ()
|
||||||
"Get git url root."
|
"Return the root git repo URL for the current file."
|
||||||
(require 'git-link)
|
(let* ((remote (git-link--select-remote))
|
||||||
(let ((remote (git-link--select-remote)))
|
(remote-url (git-link--remote-url remote))
|
||||||
(if (git-link--remote-host remote)
|
(remote-info (if remote-url (git-link--parse-remote remote-url))))
|
||||||
(format "https://%s/%s"
|
(if remote-info
|
||||||
(git-link--remote-host remote)
|
(format "https://%s/%s" (car remote-info) (cadr remote-info))
|
||||||
(git-link--remote-dir remote))
|
|
||||||
(error "Remote `%s' is unknown or contains an unsupported URL" remote))))
|
(error "Remote `%s' is unknown or contains an unsupported URL" remote))))
|
||||||
|
|
||||||
(defvar git-link-open-in-browser)
|
(defvar git-link-open-in-browser)
|
||||||
|
@ -25,11 +24,15 @@ repository root."
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +vcs/git-browse-issues ()
|
(defun +vcs/git-browse-issues ()
|
||||||
"Open the github issues page for current repo."
|
"Open the issues page for current repo."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if-let* ((root (+vcs-root)))
|
(browse-url (format "%s/issues" (+vcs-root))))
|
||||||
(browse-url (concat root "/issues"))
|
|
||||||
(user-error "No git root found!")))
|
;;;###autoload
|
||||||
|
(defun +vcs/git-browse-pulls ()
|
||||||
|
"Open the pull requests page for current repo."
|
||||||
|
(interactive)
|
||||||
|
(browse-url (format "%s/pulls" (+vcs-root))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +vcs*update-header-line (revision)
|
(defun +vcs*update-header-line (revision)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue