mirror of
https://github.com/tpope/vim-rhubarb.git
synced 2025-12-06 20:24:29 +08:00
Add support for enterprise cloud accounts
GitHub Enterprise Cloud accounts use a slightly different URL scheme, using org-\d+@github.com instead of git@ or ssh@ (or any of the other supported variations). This adds support for urls with that format to the base pattern matching so that users with enterprise cloud accounts can use vim-rhubarb as expected.
This commit is contained in:
committed by
Tim Pope
parent
857865bdab
commit
d865e427d0
@@ -29,7 +29,7 @@ function! rhubarb#HomepageForUrl(url) abort
|
||||
for domain in domains
|
||||
let domain_pattern .= '\|' . escape(split(substitute(domain, '/$', '', ''), '://')[-1], '.')
|
||||
endfor
|
||||
let base = matchstr(a:url, '^\%(https\=://\%([^@/:]*@\)\=\|git://\|git@\|ssh://git@\)\=\zs\('.domain_pattern.'\)[/:].\{-\}\ze\%(\.git\)\=/\=$')
|
||||
let base = matchstr(a:url, '^\%(https\=://\%([^@/:]*@\)\=\|git://\|git@\|ssh://git@\|org-\d\+@\|ssh://org-\d\+@\)\=\zs\('.domain_pattern.'\)[/:].\{-\}\ze\%(\.git\)\=/\=$')
|
||||
if index(domains, 'http://' . matchstr(base, '^[^:/]*')) >= 0
|
||||
return 'http://' . tr(base, ':', '/')
|
||||
elseif !empty(base)
|
||||
|
||||
Reference in New Issue
Block a user