Browse Source

Use var to store git executable location

pull/239/head
Clinton N. Dreisbach 13 years ago
parent
commit
768a4f47f2
4 changed files with 9 additions and 4 deletions
  1. +1
    -0
      autoload/vundle.vim
  2. +3
    -0
      autoload/vundle/config.vim
  3. +4
    -3
      autoload/vundle/installer.vim
  4. +1
    -1
      autoload/vundle/scripts.vim

+ 1
- 0
autoload/vundle.vim View File

@ -38,6 +38,7 @@ endif
func! vundle#rc(...) abort 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:bundle_dir = len(a:000) > 0 ? expand(a:1, 1) : expand('$HOME/.vim/bundle', 1)
let g:updated_bundles = [] let g:updated_bundles = []
let g:vundle_log = [] let g:vundle_log = []


+ 3
- 0
autoload/vundle/config.vim View File

@ -104,3 +104,6 @@ func! s:bundle.path()
return s:expand_path(g:bundle_dir.'/'.self.name) return s:expand_path(g:bundle_dir.'/'.self.name)
endf endf
func! s:vundle_git_exec()
return shellescape(g:vundle_git_exec)
endf

+ 4
- 3
autoload/vundle/installer.vim View File

@ -205,20 +205,21 @@ func! s:helptags(rtp) abort
endf endf
func! s:sync(bang, bundle) abort func! s:sync(bang, bundle) abort
let git = s:vundle_git_exec()
let git_dir = expand(a:bundle.path().'/.git/', 1) let git_dir = expand(a:bundle.path().'/.git/', 1)
if isdirectory(git_dir) || filereadable(expand(a:bundle.path().'/.git', 1)) if isdirectory(git_dir) || filereadable(expand(a:bundle.path().'/.git', 1))
if !(a:bang) | return 'todate' | endif 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')) if (has('win32') || has('win64'))
let cmd = substitute(cmd, '^cd ','cd /d ','') " add /d switch to change drives let cmd = substitute(cmd, '^cd ','cd /d ','') " add /d switch to change drives
let cmd = '"'.cmd.'"' " enclose in quotes let cmd = '"'.cmd.'"' " enclose in quotes
endif 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] let initial_sha = s:system(get_current_sha)[0:15]
else 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 = '' let initial_sha = ''
endif endif


+ 1
- 1
autoload/vundle/scripts.vim View File

@ -40,7 +40,7 @@ func! s:create_changelog() abort
let bundle = bundle_data[2] let bundle = bundle_data[2]
let cmd = 'cd '.shellescape(bundle.path()). 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 \ initial_sha.'..'.updated_sha
if (has('win32') || has('win64')) if (has('win32') || has('win64'))


Loading…
Cancel
Save