mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-09 03:53: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:[\/]')
|
if len(scp_authority) && !(has('win32') && scp_authority =~# '^\a:[\/]')
|
||||||
let path = strpart(a:remote, len(scp_authority) + 1)
|
let path = strpart(a:remote, len(scp_authority) + 1)
|
||||||
let authority = fugitive#SshHostAlias(scp_authority)
|
let authority = fugitive#SshHostAlias(scp_authority)
|
||||||
if authority !~# ':'
|
if path =~# '^/'
|
||||||
return authority . ':' . path
|
|
||||||
elseif path =~# '^/'
|
|
||||||
return 'ssh://' . authority . path
|
return 'ssh://' . authority . path
|
||||||
|
elseif path =~# '^\~'
|
||||||
|
return 'ssh://' . authority . '/' . path
|
||||||
|
elseif authority !~# ':'
|
||||||
|
return authority . ':' . path
|
||||||
endif
|
endif
|
||||||
elseif a:remote =~# '^https\=://' && s:executable('curl')
|
elseif a:remote =~# '^https\=://' && s:executable('curl')
|
||||||
if !has_key(s:redirects, a:remote)
|
if !has_key(s:redirects, a:remote)
|
||||||
|
|||||||
Reference in New Issue
Block a user