From 768a4f47f2db7ea553ccb570f76283b6f3fc509f Mon Sep 17 00:00:00 2001 From: "Clinton N. Dreisbach" Date: Wed, 14 Nov 2012 20:34:11 -0500 Subject: [PATCH] Use var to store git executable location --- autoload/vundle.vim | 1 + autoload/vundle/config.vim | 3 +++ autoload/vundle/installer.vim | 7 ++++--- autoload/vundle/scripts.vim | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/autoload/vundle.vim b/autoload/vundle.vim index 1ac74e1..78a1b79 100644 --- a/autoload/vundle.vim +++ b/autoload/vundle.vim @@ -38,6 +38,7 @@ endif func! vundle#rc(...) abort + let g:vundle_git_exec = 'git' let g:bundle_dir = len(a:000) > 0 ? expand(a:1, 1) : expand('$HOME/.vim/bundle', 1) let g:updated_bundles = [] let g:vundle_log = [] diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 55c7d7d..d108129 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -104,3 +104,6 @@ func! s:bundle.path() return s:expand_path(g:bundle_dir.'/'.self.name) endf +func! s:vundle_git_exec() + return shellescape(g:vundle_git_exec) +endf diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index f7e4375..3ae80a7 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -205,20 +205,21 @@ func! s:helptags(rtp) abort endf func! s:sync(bang, bundle) abort + let git = s:vundle_git_exec() let git_dir = expand(a:bundle.path().'/.git/', 1) if isdirectory(git_dir) || filereadable(expand(a:bundle.path().'/.git', 1)) if !(a:bang) | return 'todate' | endif - let cmd = 'cd '.shellescape(a:bundle.path()).' && git pull && git submodule update --init --recursive' + let cmd = 'cd '.shellescape(a:bundle.path()).' && ' . git . ' pull && ' . git . ' submodule update --init --recursive' if (has('win32') || has('win64')) let cmd = substitute(cmd, '^cd ','cd /d ','') " add /d switch to change drives let cmd = '"'.cmd.'"' " enclose in quotes endif - let get_current_sha = 'cd '.shellescape(a:bundle.path()).' && git rev-parse HEAD' + let get_current_sha = 'cd '.shellescape(a:bundle.path()).' && ' . git . ' rev-parse HEAD' let initial_sha = s:system(get_current_sha)[0:15] else - let cmd = 'git clone --recursive '.a:bundle.uri.' '.shellescape(a:bundle.path()) + let cmd = git . ' clone --recursive '.a:bundle.uri.' '.shellescape(a:bundle.path()) let initial_sha = '' endif diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index 53a77e1..2259ae8 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -40,7 +40,7 @@ func! s:create_changelog() abort let bundle = bundle_data[2] let cmd = 'cd '.shellescape(bundle.path()). - \ ' && git log --pretty=format:"%s %an, %ar" --graph '. + \ ' && ' . git . ' log --pretty=format:"%s %an, %ar" --graph '. \ initial_sha.'..'.updated_sha if (has('win32') || has('win64'))