Minor refactoring

This commit is contained in:
Junegunn Choi 2014-07-26 22:58:34 +09:00
parent f98c8456fa
commit d956e16f15

View File

@ -604,15 +604,11 @@ function! s:update_serial(pull, todo)
execute 'cd '.s:esc(spec.dir) execute 'cd '.s:esc(spec.dir)
let [valid, msg] = s:git_valid(spec, 0, 0) let [valid, msg] = s:git_valid(spec, 0, 0)
if valid if valid
if a:pull let result = a:pull ?
let result =
\ s:system( \ s:system(
\ printf('git checkout -q %s 2>&1 && git pull origin %s 2>&1 && git submodule update --init --recursive 2>&1', \ printf('git checkout -q %s 2>&1 && git pull origin %s 2>&1 && git submodule update --init --recursive 2>&1',
\ s:shellesc(spec.branch), s:shellesc(spec.branch))) \ s:shellesc(spec.branch), s:shellesc(spec.branch))) : 'Already installed'
let [result, error] = [result, v:shell_error != 0] let error = a:pull ? v:shell_error != 0 : 0
else
let [result, error] = ['Already installed', 0]
endif
else else
let result = msg let result = msg
let error = 1 let error = 1