From d3bd40706917af45565aefc539874ff2b62a1692 Mon Sep 17 00:00:00 2001 From: Oleg Kostyuk Date: Mon, 5 Sep 2011 03:27:24 +0300 Subject: [PATCH] Added support for g:Vundle_no_full_repo option: do not store .git for each bundle (will make update no-op) --- autoload/vundle/config.vim | 3 +++ autoload/vundle/installer.vim | 23 ++++++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 3f87e99..6a31e0a 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -9,6 +9,9 @@ func! vundle#config#init() if !exists('g:vundles') | let g:vundles = [] | endif call s:rtp_rm_a() let g:vundles = [] + if !exists('g:Vundle_no_full_repo') + let g:Vundle_no_full_repo=0 + endif endf func! vundle#config#require(vundles) abort diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index df07c3f..2513255 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -198,11 +198,24 @@ func! s:sync(bang, vundle) abort let cmd = 'git clone '.a:vundle.uri.' '.shellescape(a:vundle.path()) endif - let out = s:system(cmd) - call s:log('') - call s:log('Vundle '.a:vundle.name_spec) - call s:log('$ '.cmd) - call s:log('> '.out) + if (g:Vundle_no_full_repo) && (isdirectory(expand(a:vundle.path()))) + let cmd = 'rm -rf '.shellescape(git_dir) + let tmp = s:system(cmd) + call s:log('') + call s:log('Vundle '.a:vundle.name_spec) + call s:log('# update skipped because of Vundle_no_full_repo') + let out = 'up-to-date' + else + let out = s:system(cmd) + call s:log('') + call s:log('Vundle '.a:vundle.name_spec) + call s:log('$ '.cmd) + call s:log('> '.out) + if (g:Vundle_no_full_repo) + let cmd = 'rm -rf '.shellescape(git_dir) + let tmp = s:system(cmd) + endif + endif if 0 != v:shell_error return 'error'