From 73fb175e0124385f31faee599cc48957b40c5597 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Tue, 1 Jan 2013 23:49:12 +0800 Subject: [PATCH] Use git pull --depth only on new repo Using pull with depth option on a non-empty repo may cause some trouble. --- autoload/vundle/installer.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index cb62880..111d718 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -214,6 +214,7 @@ func! s:sync(bang, bundle, rtp) abort let get_current_sha = g:shellesc_cd('cd '.bundle_path) let get_current_sha .= ' && git rev-parse HEAD' let initial_sha = system(get_current_sha)[0:15] + let cmd .= ' && git pull origin master' else call mkdir(a:bundle.path(), 'p') let cmd .= ' && git init' @@ -225,9 +226,9 @@ func! s:sync(bang, bundle, rtp) abort let cmd .= ' && echo '.shellescape(a:rtp).' >> .git/info/sparse-checkout' endif let initial_sha = '' + let cmd .= ' && git pull --depth=1 origin master' endif - let cmd .= ' && git pull --depth=1 origin master' if empty(a:rtp) " TODO: It causes error when using rtp because no .gitmodule " is checked out