Refactor s:clone_opt to a list
Prep for using list type for command in s:spawn().
This commit is contained in:
parent
668bc0fd2a
commit
d8699755d4
17
plug.vim
17
plug.vim
|
@ -1086,11 +1086,16 @@ function! s:update_impl(pull, force, args) abort
|
||||||
normal! 2G
|
normal! 2G
|
||||||
silent! redraw
|
silent! redraw
|
||||||
|
|
||||||
let s:clone_opt = get(g:, 'plug_shallow', 1) ?
|
let s:clone_opt = []
|
||||||
\ '--depth 1' . (s:git_version_requirement(1, 7, 10) ? ' --no-single-branch' : '') : ''
|
if get(g:, 'plug_shallow', 1)
|
||||||
|
call extend(s:clone_opt, ['--depth', '1'])
|
||||||
|
if s:git_version_requirement(1, 7, 10)
|
||||||
|
call add(s:clone_opt, '--no-single-branch')
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
if has('win32unix') || has('wsl')
|
if has('win32unix') || has('wsl')
|
||||||
let s:clone_opt .= ' -c core.eol=lf -c core.autocrlf=input'
|
call extend(s:clone_opt, ['-c', 'core.eol=lf', '-c', 'core.autocrlf=input'])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let s:submodule_opt = s:git_version_requirement(2, 8) ? ' --jobs='.threads : ''
|
let s:submodule_opt = s:git_version_requirement(2, 8) ? ' --jobs='.threads : ''
|
||||||
|
@ -1426,7 +1431,7 @@ while 1 " Without TCO, Vim stack is bound to explode
|
||||||
else
|
else
|
||||||
call s:spawn(name,
|
call s:spawn(name,
|
||||||
\ printf('git clone %s %s %s %s',
|
\ printf('git clone %s %s %s %s',
|
||||||
\ has_tag ? '' : s:clone_opt,
|
\ has_tag ? '' : join(s:clone_opt, ' '),
|
||||||
\ prog,
|
\ prog,
|
||||||
\ plug#shellescape(spec.uri, {'script': 0}),
|
\ plug#shellescape(spec.uri, {'script': 0}),
|
||||||
\ plug#shellescape(s:trim(spec.dir), {'script': 0})), { 'new': 1 })
|
\ plug#shellescape(s:trim(spec.dir), {'script': 0})), { 'new': 1 })
|
||||||
|
@ -1466,7 +1471,7 @@ G_NVIM = vim.eval("has('nvim')") == '1'
|
||||||
G_PULL = vim.eval('s:update.pull') == '1'
|
G_PULL = vim.eval('s:update.pull') == '1'
|
||||||
G_RETRIES = int(vim.eval('get(g:, "plug_retries", 2)')) + 1
|
G_RETRIES = int(vim.eval('get(g:, "plug_retries", 2)')) + 1
|
||||||
G_TIMEOUT = int(vim.eval('get(g:, "plug_timeout", 60)'))
|
G_TIMEOUT = int(vim.eval('get(g:, "plug_timeout", 60)'))
|
||||||
G_CLONE_OPT = vim.eval('s:clone_opt')
|
G_CLONE_OPT = ' '.join(vim.eval('s:clone_opt'))
|
||||||
G_PROGRESS = vim.eval('s:progress_opt(1)')
|
G_PROGRESS = vim.eval('s:progress_opt(1)')
|
||||||
G_LOG_PROB = 1.0 / int(vim.eval('s:update.threads'))
|
G_LOG_PROB = 1.0 / int(vim.eval('s:update.threads'))
|
||||||
G_STOP = thr.Event()
|
G_STOP = thr.Event()
|
||||||
|
@ -2003,7 +2008,7 @@ function! s:update_ruby()
|
||||||
end
|
end
|
||||||
} if VIM::evaluate('s:mac_gui') == 1
|
} if VIM::evaluate('s:mac_gui') == 1
|
||||||
|
|
||||||
clone_opt = VIM::evaluate('s:clone_opt')
|
clone_opt = VIM::evaluate('s:clone_opt').join(' ')
|
||||||
progress = VIM::evaluate('s:progress_opt(1)')
|
progress = VIM::evaluate('s:progress_opt(1)')
|
||||||
nthr.times do
|
nthr.times do
|
||||||
mtx.synchronize do
|
mtx.synchronize do
|
||||||
|
|
Loading…
Reference in New Issue
Block a user