Make Plug{Install,Update}! trigger post-fetch checkout, submodule update

Now `:PlugInstall!` and `:PlugUpdate!` forces to update submodules.
`:PlugInstall!` now also checks out to new specified branch, tag, or
commit.

Also added tests for changing branch, tag, or commit.
This commit is contained in:
Chayoung You
2016-04-03 10:52:30 +09:00
parent 158fd28bc4
commit a61d097037
4 changed files with 58 additions and 12 deletions

View File

@@ -51,6 +51,18 @@ Execute (Initialize test environment):
let &rtp = g:base_rtp
endfunction
function! GitBranch(repo)
return system(printf('cd %s && git rev-parse --abbrev-ref HEAD', g:plugs[a:repo].dir))[:-2]
endfunction
function! GitTag(repo)
return system(printf('cd %s && git describe --tags', g:plugs[a:repo].dir))[:-2]
endfunction
function! GitCommit(repo)
return system(printf('cd %s && git rev-parse HEAD', g:plugs[a:repo].dir))[:-2]
endfunction
source $PLUG_SRC
Execute (Print Interpreter Version):