Add ssh://git@ to origin url base (#16)

This commit is contained in:
Dominic Monroe
2017-04-10 18:21:55 +01:00
committed by Tim Pope
parent 0c12c7ed7c
commit 9032c184f8

View File

@@ -30,7 +30,7 @@ function! rhubarb#homepage_for_url(url) abort
for domain in domains
let domain_pattern .= '\|' . escape(split(domain, '://')[-1], '.')
endfor
let base = matchstr(a:url, '^\%(https\=://\|git://\|git@\)\=\zs\('.domain_pattern.'\)[/:].\{-\}\ze\%(\.git\)\=$')
let base = matchstr(a:url, '^\%(https\=://\|git://\|git@\|ssh://git@\)\=\zs\('.domain_pattern.'\)[/:].\{-\}\ze\%(\.git\)\=$')
if index(domains, 'http://' . matchstr(base, '^[^:/]*')) >= 0
return 'http://' . tr(base, ':', '/')
elseif !empty(base)