Guard against missing output on :Gcommit success

This commit is contained in:
Tim Pope
2019-07-26 21:22:19 -04:00
parent ebc3f35575
commit 881ad1ed0b

View File

@@ -3111,7 +3111,7 @@ function! s:CommitCommand(line1, line2, range, count, bang, mods, reg, arg, args
return '1' . after return '1' . after
elseif empty(errors) elseif empty(errors)
let out = readfile(outfile) let out = readfile(outfile)
echo get(out, -1, '') =~# 'stash\|\d' ? get(out, -2, '') : out[-1] echo get(out, -1, '') =~# 'stash\|\d' ? get(out, -2, '') : get(out, -1, '')
return after[1:-1] return after[1:-1]
else else
echo join(errors, "\n") echo join(errors, "\n")