diff --git a/plug.vim b/plug.vim index db1f615..4e05630 100644 --- a/plug.vim +++ b/plug.vim @@ -2420,7 +2420,11 @@ function! s:diff() call s:append_ul(2, origin ? 'Pending updates:' : 'Last update:') for [k, v] in plugs let range = origin ? '..origin/'.v.branch : 'HEAD@{1}..' - let diff = s:system_chomp('git log --graph --color=never '.join(map(['--pretty=format:%x01%h%x01%d%x01%s%x01%cr', range], 's:shellesc(v:val)')), v.dir) + let cmd = 'git log --graph --color=never '.join(map(['--pretty=format:%x01%h%x01%d%x01%s%x01%cr', range], 's:shellesc(v:val)')) + if has_key(v, 'rtp') + let cmd .= ' -- '.s:shellesc(v.rtp) + endif + let diff = s:system_chomp(cmd, v.dir) if !empty(diff) let ref = has_key(v, 'tag') ? (' (tag: '.v.tag.')') : has_key(v, 'commit') ? (' '.v.commit) : '' call append(5, extend(['', '- '.k.':'.ref], map(s:lines(diff), 's:format_git_log(v:val)'))) diff --git a/test/workflow.vader b/test/workflow.vader index 5bd14e1..7e2c352 100644 --- a/test/workflow.vader +++ b/test/workflow.vader @@ -537,6 +537,51 @@ Execute (PlugDiff): Assert !empty(mapcheck("\")) q +Execute (Do not show diff for commits outside of rtp): + call plug#begin() + call plug#end() + PlugClean! + + call plug#begin() + Plug 'file://'.expand('$PLUG_FIXTURES').'/xxx' + Plug 'file://'.expand('$PLUG_FIXTURES').'/yyy', { 'rtp': 'rtp' } + call plug#end() + PlugInstall + Log getline(1, '$') + + call system('cd "$PLUG_FIXTURES/xxx" && git commit --allow-empty -m update-xxx && git tag -f xxx') + call system('cd "$PLUG_FIXTURES/yyy" && git commit --allow-empty -m update-yyy && git tag -f yyy') + + let g:plugs.yyy.tag = 'yyy' + PlugUpdate + Log getline(1, '$') + + PlugDiff + " 1 plugin(s) updated. + " [==] + " + " Last update: + " ------------ + " + " - xxx: + " * 7faa9b2 update-xxx (0 seconds ago) + " + " Pending updates: + " ---------------- + " + " N/A + " + Log getline(1, '$') + AssertEqual 14, line('$') + AssertEqual '1 plugin(s) updated.', getline(1) + AssertEqual '[==]', getline(2) + AssertEqual 'Last update:', getline(4) + AssertEqual '- xxx:', getline(7) + Assert !empty(mapcheck('o')) + Assert !empty(mapcheck('X')) + Assert !empty(mapcheck("\")) + q + ********************************************************************** ~ On-demand loading / Partial installation/update ~ **********************************************************************