From b78d67e9779b410c02bf48c1688ed6d20fb20bbf Mon Sep 17 00:00:00 2001 From: Peter Jaros Date: Mon, 27 Feb 2012 18:41:20 -0500 Subject: [PATCH] Use --git-dir= instead of cd'ing. --- autoload/vundle/installer.vim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index 0f71ebf..c63ddcf 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -198,11 +198,12 @@ func! s:sync(bang, bundle) abort let git_dir = expand(a:bundle.path().'/.git/', 1) if isdirectory(git_dir) if !(a:bang) | return 'todate' | endif - let cmd = 'cd '.shellescape(a:bundle.path()).' && git pull' + let cmd = 'git --git-dir='.shellescape(git_dir).' pull' if (has('win32') || has('win64')) - let cmd = substitute(cmd, '^cd ','cd /d ','') " add /d switch to change drives - let cmd = '"'.cmd.'"' " enclose in quotes + " For Windows, enclose in quotes. + " http://groups.google.com/group/vim_use/browse_thread/thread/bab99ec9253c59ed + let cmd = '"'.cmd.'"' endif else let cmd = 'git clone '.a:bundle.uri.' '.shellescape(a:bundle.path())