Fix blame from stage buffer

References: https://github.com/tpope/vim-fugitive/issues/1892
This commit is contained in:
Tim Pope
2021-12-01 19:48:43 -05:00
parent a099a2631c
commit c666c86882

View File

@@ -6771,7 +6771,7 @@ function! s:BlameSubcommand(line1, count, range, bang, mods, options) abort
elseif empty(files) && len(matchstr(s:DirCommitFile(@%)[1], '^\x\x\+$'))
let cmd += [matchstr(s:DirCommitFile(@%)[1], '^\x\x\+$')]
elseif empty(files) && !s:HasOpt(flags, '--reverse')
if &modified
if &modified || !empty(s:DirCommitFile(@%)[1])
let cmd += ['--contents', tempname . '.in']
silent execute 'noautocmd keepalt %write ' . s:fnameescape(tempname . '.in')
let delete_in = 1