mirror of
https://github.com/tpope/vim-rhubarb.git
synced 2026-08-12 02:42:44 +08:00
Ask Fugitive directly for the remote URL
This commit is contained in:
@@ -44,13 +44,17 @@ function! s:repo_homepage() abort
|
|||||||
if exists('b:rhubarb_homepage')
|
if exists('b:rhubarb_homepage')
|
||||||
return b:rhubarb_homepage
|
return b:rhubarb_homepage
|
||||||
endif
|
endif
|
||||||
let repo = fugitive#repo()
|
if exists('*fugitive#RemoteUrl')
|
||||||
let homepage = rhubarb#homepage_for_url(repo.config('remote.origin.url'))
|
let remote = fugitive#RemoteUrl()
|
||||||
|
else
|
||||||
|
let remote = fugitive#repo().config('remote.origin.url')
|
||||||
|
endif
|
||||||
|
let homepage = rhubarb#homepage_for_url(remote)
|
||||||
if !empty(homepage)
|
if !empty(homepage)
|
||||||
let b:rhubarb_homepage = homepage
|
let b:rhubarb_homepage = homepage
|
||||||
return b:rhubarb_homepage
|
return b:rhubarb_homepage
|
||||||
endif
|
endif
|
||||||
call s:throw('origin is not a GitHub repository')
|
call s:throw((len(remote) ? remote : 'origin') . ' is not a GitHub repository')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Section: HTTP
|
" Section: HTTP
|
||||||
|
|||||||
Reference in New Issue
Block a user