From 0f9aaee3a0bf0c84231328684cfa55a91baa3595 Mon Sep 17 00:00:00 2001 From: Dmitri Iouchtchenko Date: Thu, 12 May 2011 00:50:23 -0400 Subject: [PATCH] make clone depth configurable --- autoload/vundle/installer.vim | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index e0fbdda..741165a 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -67,7 +67,19 @@ func! s:sync(bang, bundle) abort if !(a:bang) | return 0 | endif let cmd = 'cd '.shellescape(a:bundle.path()).' && git pull' else - let cmd = 'git clone '.a:bundle.uri.' '.shellescape(a:bundle.path()) + let cmd = 'git clone ' + if has_key(a:bundle, 'depth') + let depth = a:bundle.depth + elseif exists('g:vundle_depth') + let depth = g:vundle_depth + else + " Clone as little as possible by default. + let depth = 1 + endif + if depth > 0 + let cmd .= '--depth '.depth.' ' + endif + let cmd .= a:bundle.uri.' '.shellescape(a:bundle.path()) endif silent exec '!'.cmd return 1