mirror of
https://github.com/junegunn/vim-plug.git
synced 2025-12-08 09:54:45 +08:00
Proper handling of invalid branch in parallel installer
This commit is contained in:
5
plug.vim
5
plug.vim
@@ -274,7 +274,7 @@ function! s:update_serial(pull)
|
|||||||
if s:git_valid(spec, 0)
|
if s:git_valid(spec, 0)
|
||||||
let result = a:pull ?
|
let result = a:pull ?
|
||||||
\ s:system(
|
\ s:system(
|
||||||
\ printf('git checkout -q %s && git pull origin %s 2>&1',
|
\ printf('git checkout -q %s 2>&1 && git pull origin %s 2>&1',
|
||||||
\ spec.branch, spec.branch)) : 'Already installed'
|
\ spec.branch, spec.branch)) : 'Already installed'
|
||||||
let error = a:pull ? v:shell_error != 0 : 0
|
let error = a:pull ? v:shell_error != 0 : 0
|
||||||
else
|
else
|
||||||
@@ -352,7 +352,8 @@ function! s:update_parallel(pull, threads)
|
|||||||
current_uri = `#{cd} #{dir} && git config remote.origin.url`.chomp
|
current_uri = `#{cd} #{dir} && git config remote.origin.url`.chomp
|
||||||
if $? == 0 && current_uri == uri
|
if $? == 0 && current_uri == uri
|
||||||
if pull
|
if pull
|
||||||
[true, `#{cd} #{dir} && git checkout -q #{branch} && git pull origin #{branch} 2>&1`]
|
output = `#{cd} #{dir} && git checkout -q #{branch} 2>&1 && git pull origin #{branch} 2>&1`
|
||||||
|
[$? == 0, output]
|
||||||
else
|
else
|
||||||
[true, skip]
|
[true, skip]
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user