Get initial/updated shas from git pull output.

Instead of creating a vundle_update tag to compare changes between update
and HEAD we now use the output from `git pull` to get initial/updated shas.
This commit is contained in:
Matt Furden
2012-04-18 22:28:05 -07:00
parent e999886db5
commit a52d4b91f4
2 changed files with 15 additions and 10 deletions

View File

@@ -206,7 +206,6 @@ func! s:sync(bang, bundle) abort
let cmd = substitute(cmd, '^cd ','cd /d ','') " add /d switch to change drives
let cmd = '"'.cmd.'"' " enclose in quotes
endif
call s:add_update_tag(a:bundle)
else
let cmd = 'git clone '.a:bundle.uri.' '.shellescape(a:bundle.path())
endif
@@ -227,7 +226,7 @@ func! s:sync(bang, bundle) abort
return 'todate'
endif
call add(g:updated_bundles, a:bundle)
call s:add_to_updated_bundles(out, a:bundle)
return 'updated'
endf
@@ -235,9 +234,12 @@ func! s:system(cmd) abort
return system(a:cmd)
endf
func! s:add_update_tag(bundle) abort
call s:system('cd '.shellescape(a:bundle.path()).
\ ' && git tag -a vundle_update -m "Last Vundle Update" -f')
func! s:add_to_updated_bundles(out, bundle) abort
let git_pull_shas = matchlist(a:out, 'Updating \(\w\+\)..\(\w\+\)')
let initial_sha = git_pull_shas[1]
let updated_sha = git_pull_shas[2]
call add(g:updated_bundles, [initial_sha, updated_sha, a:bundle])
endfunc
func! s:log(str) abort