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 else
noautocmd silent execute '!'.command.' > '.outfile.' 2> '.errorfile noautocmd silent execute '!'.command.' > '.outfile.' 2> '.errorfile
endif endif
let shell_error = v:shell_error
finally finally
execute cd.'`=dir`' execute cd.'`=dir`'
endtry endtry
if !has('gui_running') if !has('gui_running')
redraw! redraw!
endif endif
if !v:shell_error if !shell_error
if filereadable(outfile) if filereadable(outfile)
for line in readfile(outfile) for line in readfile(outfile)
echo line echo line