Shallow clone by default (#122 #217)

This commit is contained in:
Junegunn Choi
2015-04-28 14:12:00 +09:00
parent 8f1df15cc3
commit 80ca4ebf54
3 changed files with 49 additions and 14 deletions

View File

@@ -270,9 +270,11 @@ Execute (PlugDiff - 'No updates.'):
AssertEqual 'No updates.', getline(1)
q
Execute (Rollback recent updates, PlugUpdate, then PlugDiff):
Execute (New commits on remote, PlugUpdate, then PlugDiff):
for repo in ['seoul256.vim', 'vim-emoji']
call system(printf('cd %s/%s && git reset HEAD^^ --hard', g:plug_home, repo))
for _ in range(2)
call system(printf('cd /tmp/junegunn/%s && git commit --allow-empty -m "update"', repo))
endfor
endfor
PlugUpdate
@@ -639,8 +641,8 @@ Execute (On update):
Plug 'junegunn/vim-pseudocl', { 'do': 'touch updated' }
call plug#end()
" Reset for updates
call system('cd '.g:plugs['vim-pseudocl'].dir.' && git reset --hard HEAD^')
" New commits on remote
call system('cd /tmp/junegunn/vim-pseudocl && git commit --allow-empty -m "update"')
silent PlugUpdate
Log getline(1, '$')
@@ -703,6 +705,7 @@ Execute (Using Funcref):
Plug 'junegunn/vim-pseudocl', { 'do': function('PlugUpdated') }
call plug#end()
call system('cd /tmp/junegunn/vim-easy-align && git commit --allow-empty -m "update"')
call system('cd '.g:plugs['vim-easy-align'].dir.' && git reset --hard HEAD^')
call system('rm -rf '.g:plugs['vim-pseudocl'].dir)
@@ -1073,3 +1076,23 @@ Execute (PlugSnapshot / #154 issues with paths containing spaces):
AssertEqual 'snapshot.sh', fnamemodify(expand('%'), ':t')
q
**********************************************************************
Execute (#221 Shallow-clone and tag option):
call plug#begin(temp_plugged)
Plug 'junegunn/goyo.vim'
call plug#end()
PlugInstall
execute 'cd' g:plugs['goyo.vim'].dir
Assert len(split(system('git log --oneline'), '\n')) == 1
Assert filereadable('.git/shallow')
Plug 'junegunn/goyo.vim', { 'tag': '1.5.3' }
PlugUpdate
Assert len(split(system('git log --oneline'), '\n')) > 1
Assert system('git describe --tag') =~ '^1.5.3'
Assert !filereadable('.git/shallow')
cd -
q