Ensure v:shell_error comes from correct command

Closes https://github.com/tpope/vim-fugitive/issues/648
This commit is contained in:
Tim Pope
2017-02-25 16:36:41 -05:00
parent f44845e440
commit c5c1bd66d8

View File

@@ -1060,13 +1060,14 @@ function! s:Commit(args, ...) abort
else
noautocmd silent execute '!'.command.' > '.outfile.' 2> '.errorfile
endif
let shell_error = v:shell_error
finally
execute cd.'`=dir`'
endtry
if !has('gui_running')
redraw!
endif
if !v:shell_error
if !shell_error
if filereadable(outfile)
for line in readfile(outfile)
echo line