Skip to content

Commit b3e794b

Browse files
committed
avoid error when string not have \t
1 parent 5b2a6e1 commit b3e794b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plug.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2050,14 +2050,14 @@ function! s:git_validate(spec, check_branch)
20502050
let [output, shellerror] = s:system(printf(
20512051
\ 'git rev-list --count --left-right HEAD...origin/%s',
20522052
\ a:spec.branch), a:spec.dir)
2053-
let [ahead, behind] = split(s:lastline(output), '\t')
2053+
let [ahead; behind] = split(s:lastline(output), '\t')
20542054
if !shellerror && ahead
2055-
if behind
2055+
if len(behind) > 0
20562056
" Only mention PlugClean if diverged, otherwise it's likely to be
20572057
" pushable (and probably not that messed up).
20582058
let err = printf(
20592059
\ "Diverged from origin/%s (%d commit(s) ahead and %d commit(s) behind!\n"
2060-
\ .'Backup local changes and run PlugClean and PlugUpdate to reinstall it.', a:spec.branch, ahead, behind)
2060+
\ .'Backup local changes and run PlugClean and PlugUpdate to reinstall it.', a:spec.branch, ahead, behind[0])
20612061
else
20622062
let err = printf("Ahead of origin/%s by %d commit(s).\n"
20632063
\ .'Cannot update until local changes are pushed.',

0 commit comments

Comments
 (0)