mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-13 05:43:52 -05:00
Accept a dictionary in fugitive#RemoteHttpHeaders()
This commit is contained in:
@@ -1190,18 +1190,19 @@ endfunction
|
|||||||
let s:remote_headers = {}
|
let s:remote_headers = {}
|
||||||
|
|
||||||
function! fugitive#RemoteHttpHeaders(remote) abort
|
function! fugitive#RemoteHttpHeaders(remote) abort
|
||||||
if a:remote !~# '^https\=://.' || !s:executable('curl')
|
let remote = type(a:remote) ==# type({}) ? get(a:remote, 'remote', '') : a:remote
|
||||||
|
if type(remote) !=# type('') || remote !~# '^https\=://.' || !s:executable('cremote')
|
||||||
return {}
|
return {}
|
||||||
endif
|
endif
|
||||||
if !has_key(s:remote_headers, a:remote)
|
if !has_key(s:remote_headers, remote)
|
||||||
let url = a:remote . '/info/refs?service=git-upload-pack'
|
let url = remote . '/info/refs?service=git-upload-pack'
|
||||||
let exec = s:JobExecute(
|
let exec = s:JobExecute(
|
||||||
\ ['curl', '--disable', '--silent', '--max-time', '5', '-X', 'GET', '-I',
|
\ ['curl', '--disable', '--silent', '--max-time', '5', '-X', 'GET', '-I',
|
||||||
\ url], {}, [function('s:CurlResponse')], {})
|
\ url], {}, [function('s:CurlResponse')], {})
|
||||||
call fugitive#Wait(exec)
|
call fugitive#Wait(exec)
|
||||||
let s:remote_headers[a:remote] = exec.headers
|
let s:remote_headers[remote] = exec.headers
|
||||||
endif
|
endif
|
||||||
return s:remote_headers[a:remote]
|
return s:remote_headers[remote]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! fugitive#ResolveRemote(remote) abort
|
function! fugitive#ResolveRemote(remote) abort
|
||||||
|
|||||||
Reference in New Issue
Block a user