From 85b119d69c89c3924396c95ef02e62e8db7eaa10 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sun, 14 Feb 2010 15:55:09 -0500 Subject: [PATCH] Fix :Gdiff path/to/file --- plugin/fugitive.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 4ade28d..d431d70 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -1011,14 +1011,14 @@ function! s:Diff(...) abort let file = s:buffer().path(':0:') elseif a:1 =~# '^:/' try - let file = s:repo().rev_parse(a:1) + let file = s:repo().rev_parse(a:1).s:buffer().path(':') catch /^fugitive:/ return 'echoerr v:errmsg' endtry else let file = s:buffer().expand(a:1) endif - if file !~ ':' && file !~ '^/' + if file !~# ':' && file !~# '^/' && s:repo().git_chomp('cat-file','-t',file) =~# '^\%(tag\|commit\)$' let file = file.s:buffer().path(':') endif else