Skip to content

Commit e6a775e

Browse files
blueyedjunegunn
authored andcommitted
Fix handling of changed up-to-date msg from Git (#724)
The msg was changed from 'Already up-to-date' to 'Already up to date'.
1 parent 96375cb commit e6a775e

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

plug.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ function! s:finish(pull)
908908
call add(msgs, "Press 'R' to retry.")
909909
endif
910910
if a:pull && len(s:update.new) < len(filter(getline(5, '$'),
911-
\ "v:val =~ '^- ' && stridx(v:val, 'Already up-to-date') < 0"))
911+
\ "v:val =~ '^- ' && v:val !~# 'Already up.to.date'"))
912912
call add(msgs, "Press 'D' to see the updated changes.")
913913
endif
914914
echo join(msgs, ' ')

test/test.vader

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ Execute (Initialize test environment):
3737
g/^$/d
3838
endfunction
3939

40-
function! AssertExpect(bang, pat, cnt)
40+
function! AssertExpect(bang, pat, cnt, ...)
4141
let op = a:bang ? '==#' : '=~#'
42-
AssertEqual a:cnt, len(filter(getline(1, '$'), "v:val ".op." '".a:pat."'"))
42+
let args = [a:cnt, len(filter(getline(1, '$'), "v:val ".op." '".a:pat."'"))] + a:000
43+
call call('vader#assert#equal', args)
4344
endfunction
4445
command! -nargs=+ -bang AssertExpect call AssertExpect('<bang>' == '!', <args>)
4546

test/workflow.vader

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ Execute (PlugUpdate to install both again):
328328

329329
Execute (PlugUpdate only to find out plugins are up-to-date, D key to check):
330330
PlugUpdate
331-
AssertExpect 'Already up-to-date', 2
331+
AssertExpect 'Already up.to.date', 2, 'Expected 2 times "Already up-to-date", but got: '.string(getline(1, '$'))
332332
normal D
333333
AssertEqual '0 plugin(s) updated.', getline(1)
334334
q
@@ -1613,21 +1613,21 @@ Execute (#532 - Reuse plug window):
16131613
call system(printf('cd "%s" && git commit --allow-empty -m "dummy"', g:plugs['goyo.vim'].dir))
16141614

16151615
PlugDiff
1616-
AssertEqual 1, winnr()
1617-
AssertEqual 2, winnr('$')
1616+
AssertEqual 1, winnr(), 'Current window is #1 after PlugDiff (but is '.winnr().')'
1617+
AssertEqual 2, winnr('$'), 'Two windows after PlugDiff (but got '.winnr('$').')'
16181618

16191619
" Open preview window
16201620
execute "normal ]]jo"
1621-
AssertEqual 2, winnr()
1622-
AssertEqual 3, winnr('$')
1621+
AssertEqual 2, winnr(), 'Current window is #2 after opening preview (but is '.winnr().')'
1622+
AssertEqual 3, winnr('$'), 'Three windows with preview (but got '.winnr('$').')'
16231623

16241624
" Move plug window to the right
16251625
wincmd L
1626-
AssertEqual 3, winnr()
1627-
AssertEqual 3, winnr('$')
1626+
AssertEqual 3, winnr(), 'Current window is #3 after moving window (but is '.winnr().')'
1627+
AssertEqual 3, winnr('$'), 'Three windows after moving window (but got '.winnr('$').')'
16281628

16291629
" Reuse plug window. Preview window is closed.
16301630
PlugStatus
1631-
AssertEqual 2, winnr()
1632-
AssertEqual 2, winnr('$')
1631+
AssertEqual 2, winnr(), 'Current window is #2 after PlugStatus (but is '.winnr().')'
1632+
AssertEqual 2, winnr('$'), 'Three windows after PlugStatus (but got '.winnr('$').')'
16331633
q

0 commit comments

Comments
 (0)