mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-12 05:13:53 -05:00
Add warning for editing invalid Fugitive URL
Closes https://github.com/tpope/vim-fugitive/issues/1060
This commit is contained in:
@@ -2841,6 +2841,9 @@ function! fugitive#BufReadCmd(...) abort
|
|||||||
let amatch = a:0 ? a:1 : expand('<amatch>')
|
let amatch = a:0 ? a:1 : expand('<amatch>')
|
||||||
try
|
try
|
||||||
let [dir, rev] = s:DirRev(amatch)
|
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]
|
let b:fugitive_type = system(fugitive#Prepare(dir, 'cat-file', '-t', rev))[0:-2]
|
||||||
if v:shell_error
|
if v:shell_error
|
||||||
unlet b:fugitive_type
|
unlet b:fugitive_type
|
||||||
|
|||||||
Reference in New Issue
Block a user