mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-13 13:53:51 -05:00
Remove error handler from status BufReadCmd
The only error that should be possible here now is the version check, so do that explicitly instead.
This commit is contained in:
@@ -2714,6 +2714,7 @@ function! s:MapStatus() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! fugitive#BufReadStatus(cmdbang) abort
|
function! fugitive#BufReadStatus(cmdbang) abort
|
||||||
|
exe s:VersionCheck()
|
||||||
let amatch = s:Slash(expand('%:p'))
|
let amatch = s:Slash(expand('%:p'))
|
||||||
if a:cmdbang
|
if a:cmdbang
|
||||||
unlet! b:fugitive_expanded
|
unlet! b:fugitive_expanded
|
||||||
@@ -2752,7 +2753,7 @@ function! fugitive#BufReadStatus(cmdbang) abort
|
|||||||
let head = FugitiveHead(11, dir)
|
let head = FugitiveHead(11, dir)
|
||||||
|
|
||||||
elseif fugitive#Wait(status).exit_status
|
elseif fugitive#Wait(status).exit_status
|
||||||
throw 'fugitive: ' . s:JoinChomp(status.stderr)
|
return 'echoerr ' . string('fugitive: ' . s:JoinChomp(status.stderr))
|
||||||
|
|
||||||
elseif status.args[-1] ==# '--porcelain=v2'
|
elseif status.args[-1] ==# '--porcelain=v2'
|
||||||
let output = split(tr(join(status.stdout, "\1"), "\1\n", "\n\1"), "\1", 1)[0:-2]
|
let output = split(tr(join(status.stdout, "\1"), "\1\n", "\n\1"), "\1", 1)[0:-2]
|
||||||
@@ -3033,8 +3034,6 @@ function! fugitive#BufReadStatus(cmdbang) abort
|
|||||||
|
|
||||||
let b:fugitive_reltime = reltime()
|
let b:fugitive_reltime = reltime()
|
||||||
return s:DoAutocmd('User FugitiveIndex')
|
return s:DoAutocmd('User FugitiveIndex')
|
||||||
catch /^fugitive:/
|
|
||||||
return 'echoerr ' . string(v:exception)
|
|
||||||
finally
|
finally
|
||||||
let b:fugitive_type = 'index'
|
let b:fugitive_type = 'index'
|
||||||
endtry
|
endtry
|
||||||
@@ -3102,15 +3101,16 @@ endfunction
|
|||||||
|
|
||||||
function! fugitive#BufReadCmd(...) abort
|
function! fugitive#BufReadCmd(...) abort
|
||||||
let amatch = a:0 ? a:1 : expand('<amatch>')
|
let amatch = a:0 ? a:1 : expand('<amatch>')
|
||||||
|
let [dir, rev] = s:DirRev(amatch)
|
||||||
|
if empty(dir)
|
||||||
|
return 'echo "Invalid Fugitive URL"'
|
||||||
|
endif
|
||||||
|
call s:InitializeBuffer(dir)
|
||||||
|
if rev ==# ':'
|
||||||
|
return fugitive#BufReadStatus(v:cmdbang)
|
||||||
|
endif
|
||||||
try
|
try
|
||||||
let [dir, rev] = s:DirRev(amatch)
|
if rev =~# '^:\d$'
|
||||||
if empty(dir)
|
|
||||||
return 'echo "Invalid Fugitive URL"'
|
|
||||||
endif
|
|
||||||
call s:InitializeBuffer(dir)
|
|
||||||
if rev ==# ':'
|
|
||||||
return fugitive#BufReadStatus(v:cmdbang)
|
|
||||||
elseif rev =~# '^:\d$'
|
|
||||||
let b:fugitive_type = 'stage'
|
let b:fugitive_type = 'stage'
|
||||||
else
|
else
|
||||||
let r = fugitive#Execute([dir, 'cat-file', '-t', rev])
|
let r = fugitive#Execute([dir, 'cat-file', '-t', rev])
|
||||||
|
|||||||
Reference in New Issue
Block a user