From 848841083d5d4550b5ebbd3bd67dfb3e5146b64a Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Thu, 19 Jul 2018 13:22:21 -0400 Subject: [PATCH] Ask Fugitive directly for the remote URL --- autoload/rhubarb.vim | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/autoload/rhubarb.vim b/autoload/rhubarb.vim index a4d3303..eeca868 100644 --- a/autoload/rhubarb.vim +++ b/autoload/rhubarb.vim @@ -44,13 +44,17 @@ function! s:repo_homepage() abort if exists('b:rhubarb_homepage') return b:rhubarb_homepage endif - let repo = fugitive#repo() - let homepage = rhubarb#homepage_for_url(repo.config('remote.origin.url')) + if exists('*fugitive#RemoteUrl') + let remote = fugitive#RemoteUrl() + else + let remote = fugitive#repo().config('remote.origin.url') + endif + let homepage = rhubarb#homepage_for_url(remote) if !empty(homepage) let b:rhubarb_homepage = homepage return b:rhubarb_homepage endif - call s:throw('origin is not a GitHub repository') + call s:throw((len(remote) ? remote : 'origin') . ' is not a GitHub repository') endfunction " Section: HTTP