mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-08 11:33:47 -05:00
Favor ssh:// URL over scp style when possible
This is much easier to deal with on other end, so if a :GBrowse provider doesn't care about relative scp paths, allow them to ditch the scp parsing entirely.
This commit is contained in:
@@ -1175,10 +1175,12 @@ function! fugitive#ResolveRemote(remote) abort
|
||||
if len(scp_authority) && !(has('win32') && scp_authority =~# '^\a:[\/]')
|
||||
let path = strpart(a:remote, len(scp_authority) + 1)
|
||||
let authority = fugitive#SshHostAlias(scp_authority)
|
||||
if authority !~# ':'
|
||||
return authority . ':' . path
|
||||
elseif path =~# '^/'
|
||||
if path =~# '^/'
|
||||
return 'ssh://' . authority . path
|
||||
elseif path =~# '^\~'
|
||||
return 'ssh://' . authority . '/' . path
|
||||
elseif authority !~# ':'
|
||||
return authority . ':' . path
|
||||
endif
|
||||
elseif a:remote =~# '^https\=://' && s:executable('curl')
|
||||
if !has_key(s:redirects, a:remote)
|
||||
|
||||
Reference in New Issue
Block a user