mirror of
https://github.com/junegunn/vim-plug.git
synced 2024-12-23 20:45:31 -07:00
Implement ability to override git clone options for a particular plugin
This commit is contained in:
parent
b6050d6f03
commit
2bd0f083ca
@ -216,6 +216,7 @@ Reload .vimrc and `:PlugInstall` to install plugins.
|
||||
`on` | On-demand loading: Commands or <Plug>-mappings
|
||||
`for` | On-demand loading: File types
|
||||
`frozen` | Do not update unless explicitly specified
|
||||
`clone_opt` | Override git cloning options for the plugin
|
||||
------------------------+-----------------------------------------------
|
||||
|
||||
|
||||
|
4
plug.vim
4
plug.vim
@ -1337,6 +1337,8 @@ while 1 " Without TCO, Vim stack is bound to explode
|
||||
redraw
|
||||
|
||||
let has_tag = has_key(spec, 'tag')
|
||||
let has_clone_opt = has_key(spec, 'clone_opt')
|
||||
let clone_opt = has_clone_opt ? spec.clone_opt : s:clone_opt
|
||||
if !new
|
||||
let [error, _] = s:git_validate(spec, 0)
|
||||
if empty(error)
|
||||
@ -1352,7 +1354,7 @@ while 1 " Without TCO, Vim stack is bound to explode
|
||||
else
|
||||
call s:spawn(name,
|
||||
\ printf('git clone %s %s %s %s 2>&1',
|
||||
\ has_tag ? '' : s:clone_opt,
|
||||
\ has_tag ? '' : clone_opt,
|
||||
\ prog,
|
||||
\ s:shellesc(spec.uri),
|
||||
\ s:shellesc(s:trim(spec.dir))), { 'new': 1 })
|
||||
|
Loading…
Reference in New Issue
Block a user