Skip to content

Commit

Permalink
avoid error when string not have \t
Browse files Browse the repository at this point in the history
  • Loading branch information
mattn committed Feb 22, 2017
1 parent 5b2a6e1 commit 352cc75
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plug.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2050,14 +2050,14 @@ function! s:git_validate(spec, check_branch)
let [output, shellerror] = s:system(printf(
\ 'git rev-list --count --left-right HEAD...origin/%s',
\ a:spec.branch), a:spec.dir)
let [ahead, behind] = split(s:lastline(output), '\t')
let [ahead; behind] = split(s:lastline(output), '\t')
if !shellerror && ahead
if behind
if len(behind) == 1
" Only mention PlugClean if diverged, otherwise it's likely to be
" pushable (and probably not that messed up).
let err = printf(
\ "Diverged from origin/%s (%d commit(s) ahead and %d commit(s) behind!\n"
\ .'Backup local changes and run PlugClean and PlugUpdate to reinstall it.', a:spec.branch, ahead, behind)
\ .'Backup local changes and run PlugClean and PlugUpdate to reinstall it.', a:spec.branch, ahead, behind[0])
else
let err = printf("Ahead of origin/%s by %d commit(s).\n"
\ .'Cannot update until local changes are pushed.',
Expand Down

0 comments on commit 352cc75

Please sign in to comment.