Add warning for editing invalid Fugitive URL
Closes https://github.com/tpope/vim-fugitive/issues/1060
This commit is contained in:
parent
35f94eef48
commit
b7e57637ba
@ -2841,6 +2841,9 @@ function! fugitive#BufReadCmd(...) abort
|
||||
let amatch = a:0 ? a:1 : expand('<amatch>')
|
||||
try
|
||||
let [dir, rev] = s:DirRev(amatch)
|
||||
if empty(dir)
|
||||
return 'echo "Invalid Fugitive URL"'
|
||||
endif
|
||||
let b:fugitive_type = system(fugitive#Prepare(dir, 'cat-file', '-t', rev))[0:-2]
|
||||
if v:shell_error
|
||||
unlet b:fugitive_type
|
||||
|
Loading…
Reference in New Issue
Block a user