diff --git a/autoload/SpaceVim/plugins/manager.vim b/autoload/SpaceVim/plugins/manager.vim index e7dbabdf6..b05e44a5b 100644 --- a/autoload/SpaceVim/plugins/manager.vim +++ b/autoload/SpaceVim/plugins/manager.vim @@ -246,6 +246,11 @@ function! s:on_install_stdout(id, data, event) abort endfunction " @vimlint(EVL103, 0, a:event) +function! s:lock_revision(repo) abort + let cmd = ['git', 'checkout', '-C', a:repo.path, 'a:repo.rev'] + call s:VIM_CO.system(cmd) +endfunction + " here if a:data == 0, git pull succeed function! s:on_install_exit(id, data, event) abort if a:data == 0 && a:event ==# 'exit' @@ -255,6 +260,9 @@ function! s:on_install_exit(id, data, event) abort endif call s:set_buf_line(s:plugin_manager_buffer, 1, 'Installing plugins (' . s:pct . '/' . s:total . ')') call s:set_buf_line(s:plugin_manager_buffer, 2, s:status_bar()) + if get(s:pulling_repos[a:id], 'rev', '') !=# '' + call s:lock_revision(s:pulling_repos[a:id]) + endif call remove(s:pulling_repos, string(a:id)) if !empty(s:plugins) call s:install(dein#get(s:LIST.shift(s:plugins)))