From dc5320630dbf5b923d0f35000015c66f3f3c1816 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 19 Nov 2019 15:05:11 -0500 Subject: [PATCH] Provide explanatory error on :Gdiff ~ References https://github.com/tpope/vim-fugitive/issues/1402 --- autoload/fugitive.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 2b05056..9bd089c 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -4633,6 +4633,8 @@ function! fugitive#Diffsplit(autodir, keepfocus, mods, arg, args) abort elseif arg =~# '^:\d$' exe s:DirCheck() let file = s:Relative(arg . ':') + elseif arg =~# '^[~^]\d*$' + return 'echoerr ' . string('fugitive: change ' . arg . ' to !' . arg . ' to diff against ancestor') else try let file = arg =~# '^:/.' ? fugitive#RevParse(arg) . s:Relative(':') : s:Expand(arg)