commit c33d7fcb9f0f85046ea2931ad135f58587abcaab (tree)
parent d176cca5ae8c47e33e54b1fffd578cb1e01ef773
Author: Tim Pope <code@tpope.net>
Date: Thu, 11 Jul 2019 11:58:00 -0400
Show stderr on :Gcommit
References https://github.com/tpope/vim-fugitive/pull/1115
Diffstat:
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim
@@ -2996,10 +2996,9 @@ function! s:CommitCommand(line1, line2, range, count, bang, mods, reg, arg, args
redraw!
endif
if !exec_error
+ echo join(errors, "\n")
if filereadable(outfile)
- for line in readfile(outfile)
- echo line
- endfor
+ echo join(readfile(outfile), "\n")
endif
call fugitive#ReloadStatus(dir, 1)
return after[1:-1]
@@ -3036,11 +3035,13 @@ function! s:CommitCommand(line1, line2, range, count, bang, mods, reg, arg, args
let b:fugitive_commit_arguments = argv
setlocal bufhidden=wipe filetype=gitcommit
return '1' . after
- elseif error ==# '!'
- echo get(readfile(outfile), -1, '')
+ elseif empty(errors)
+ let out = readfile(outfile)
+ echo get(out, -1, '') =~# 'stash\|\d' ? get(out, -2, '') : out[-1]
return after[1:-1]
else
- call s:throw(empty(error)?join(errors, ' '):error)
+ echo join(errors, "\n")
+ return after[1:-1]
endif
endif
catch /^fugitive:/