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 committed 2016-04-04 14:05:35 +09:00
1 parent 158fd28bc4
commit a61d097037
4 files changed
+58 -12

No files matched your search

+12
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):