Fix #139 - Use git fetch+merge instead of pull

This commit is contained in:
Junegunn Choi
2015-01-08 23:21:32 +09:00
parent fdf1e53da5
commit 0e9fa672f8
4 changed files with 92 additions and 2 deletions

View File

@@ -72,3 +72,80 @@ Execute (#131 Syntax error):
silent PlugInstall
redir END
Assert out =~ 'Invalid plug directory: /no-permission'
**********************************************************************
Execute (#139-1 Using new remote branch):
" Make sure to remove the clone
call plug#begin('$TMPDIR/plugged')
call plug#end()
PlugClean!
" Install master branch
call plug#begin('$TMPDIR/plugged')
Plug expand('file:///$TMPDIR/new-branch')
call plug#end()
PlugUpdate
unlet! g:foo g:bar g:baz
call plug#load('new-branch')
Assert exists('g:foo'), 'g:foo should be found'
Assert !exists('g:bar'), 'g:bar should not be found'
Assert !exists('g:baz'), 'g:baz should not be found'
" Create a new branch on origin
call system('cd $TMPDIR/new-branch && git checkout -b new &&'
\. 'echo "let g:bar = 1" > plugin/bar.vim && git add plugin/bar.vim &&'
\. 'git commit -m second')
" We're setting up two plugins so that parallel installer is used
call plug#begin('$TMPDIR/plugged')
Plug 'junegunn/seoul256.vim'
Plug expand('file:///$TMPDIR/new-branch'), 'new'
call plug#end()
PlugUpdate
silent %y
Log @"
Assert @" !~? 'error', 'Should be able to use new remote branch: ' . @"
unlet! g:foo g:bar g:baz
call plug#load('new-branch')
Assert exists('g:foo'), 'g:foo should be found'
Assert exists('g:bar'), 'g:bar should be found'
Assert !exists('g:baz'), 'g:baz should not be found'
call PlugStatusSorted()
Expect:
- new-branch: OK
- seoul256.vim: OK
Finished. 0 error(s).
[==]
Execute (#139-2 Using yet another new remote branch):
" Create another branch on origin
call system('cd $TMPDIR/new-branch && git checkout master &&'
\. 'git checkout -b brand-new &&'
\. 'echo "let g:baz = 1" > plugin/baz.vim && git add plugin/baz.vim &&'
\. 'git commit -m thirf')
" Test Vim installer here
call plug#begin('$TMPDIR/plugged')
Plug expand('file:///$TMPDIR/new-branch'), 'brand-new'
call plug#end()
PlugUpdate
silent %y
Log @"
Assert @" !~? 'error', 'Should be able to use new remote branch: ' . @"
unlet! g:foo g:bar g:baz
call plug#load('new-branch')
Assert exists('g:foo'), 'g:foo should be found'
Assert !exists('g:bar'), 'g:bar should not be found'
Assert exists('g:baz'), 'g:baz should be found'
call PlugStatusSorted()
Expect:
- new-branch: OK
Finished. 0 error(s).
[=]

View File

@@ -51,6 +51,7 @@ EOF
init() {
rm -rf $PLUG_FIXTURES/{xxx,yyy,z1,z2}
rm -rf $TMPDIR/new-branch
make_dirs xxx/ xxx
make_dirs xxx/after xxx
@@ -64,6 +65,16 @@ DOC
make_dirs z1/ z1
make_dirs z2/ z2
(
cd $TMPDIR
git init new-branch
cd new-branch
mkdir plugin
echo 'let g:foo = 1' > plugin/foo.vim
git add plugin/foo.vim
git commit -m initial
)
}
cat > /tmp/mini-vimrc << VIMRC