Fix :Gdiff path/to/file
This commit is contained in:
parent
d527faa6cb
commit
85b119d69c
@ -1011,14 +1011,14 @@ function! s:Diff(...) abort
|
|||||||
let file = s:buffer().path(':0:')
|
let file = s:buffer().path(':0:')
|
||||||
elseif a:1 =~# '^:/'
|
elseif a:1 =~# '^:/'
|
||||||
try
|
try
|
||||||
let file = s:repo().rev_parse(a:1)
|
let file = s:repo().rev_parse(a:1).s:buffer().path(':')
|
||||||
catch /^fugitive:/
|
catch /^fugitive:/
|
||||||
return 'echoerr v:errmsg'
|
return 'echoerr v:errmsg'
|
||||||
endtry
|
endtry
|
||||||
else
|
else
|
||||||
let file = s:buffer().expand(a:1)
|
let file = s:buffer().expand(a:1)
|
||||||
endif
|
endif
|
||||||
if file !~ ':' && file !~ '^/'
|
if file !~# ':' && file !~# '^/' && s:repo().git_chomp('cat-file','-t',file) =~# '^\%(tag\|commit\)$'
|
||||||
let file = file.s:buffer().path(':')
|
let file = file.s:buffer().path(':')
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user