From 1e755064e9ffedccb90b1de19de3db507ab84ac1 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 6 Oct 2015 20:33:41 -0400 Subject: [PATCH] Better error on :Gwrite failure References https://github.com/tpope/vim-fugitive/issues/696 --- plugin/fugitive.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 60e27c4..d667100 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -1461,6 +1461,9 @@ function! s:Write(force,...) abort let mytab = tabpagenr() let mybufnr = bufnr('') let path = a:0 ? join(a:000, ' ') : s:buffer().path() + if empty(path) + return 'echoerr '.string('fugitive: cannot determine file path') + endif if path =~# '^:\d\>' return 'write'.(a:force ? '! ' : ' ').s:fnameescape(s:repo().translate(s:buffer().expand(path))) endif