mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
Handle file which does not exist in diff base
If g:gitgutter_diff_base has been set and the file being processed does not exist in that branch/commit, ensure that every line is marked as added - this is how git-diff behaves. Fixes #855.
This commit is contained in:
@@ -46,6 +46,8 @@ function! gitgutter#process_buffer(bufnr, force) abort
|
||||
call gitgutter#debug#log('Not tracked: '.gitgutter#utility#file(a:bufnr))
|
||||
catch /gitgutter assume unchanged/
|
||||
call gitgutter#debug#log('Assume unchanged: '.gitgutter#utility#file(a:bufnr))
|
||||
catch /gitgutter file unknown in base/
|
||||
let diff = gitgutter#diff#hunk_header_showing_every_line_added(a:bufnr)
|
||||
catch /gitgutter diff failed/
|
||||
call gitgutter#debug#log('Diff failed: '.gitgutter#utility#file(a:bufnr))
|
||||
call gitgutter#hunk#reset(a:bufnr)
|
||||
|
||||
Reference in New Issue
Block a user