Skip to content

Commit e929534

Browse files
committed
Fix #362 - Do not show future changes in PlugDiff
1 parent 52d7da3 commit e929534

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

plug.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1998,7 +1998,7 @@ function! s:diff()
19981998
continue
19991999
endif
20002000

2001-
let diff = s:system_chomp('git log --pretty=format:"%h %s (%cr)" "HEAD...HEAD@{1}"', v.dir)
2001+
let diff = s:system_chomp('git log --left-only --pretty=format:"%h %s (%cr)" "HEAD...HEAD@{1}"', v.dir)
20022002
if !empty(diff)
20032003
call append(1, '')
20042004
call append(2, '- '.k.':')

test/workflow.vader

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,24 @@ Execute (Reuse Plug window in another tab):
352352
q
353353
unlet tabnr
354354

355+
Execute (contd. PlugDiff should not show inverted history):
356+
" Additional PlugUpdate to clear diff
357+
PlugUpdate
358+
PlugDiff
359+
Log getline(1, '$')
360+
361+
" Checking out older revisions
362+
for repo in values(g:plugs)
363+
call system(printf('cd %s && git reset HEAD^ --hard', shellescape(repo.dir)))
364+
endfor
365+
unlet repo
366+
367+
" PlugDiff should not report the changes i.e. git log --left-only
368+
PlugDiff
369+
Log getline(1, '$')
370+
AssertEqual 'No updates.', getline(1)
371+
q
372+
355373
**********************************************************************
356374
~ On-demand loading / Partial installation/update ~
357375
**********************************************************************

0 commit comments

Comments
 (0)