diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 0e0cb00..f1f3818 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -3549,13 +3549,7 @@ function! s:Blame(bang, line1, line2, count, mods, args) abort let cmd += ['--', expand('%:p')] let basecmd = escape(fugitive#Prepare(cmd), '!#%') try - let cd = s:Cd() - let tree = s:Tree() - let cdback = s:Cd(tree) - if len(tree) && s:cpath(tree) !=# s:cpath(getcwd()) - let cwd = getcwd() - execute cd s:fnameescape(tree) - endif + let cdback = s:Cd(s:Tree()) let error = tempname() let temp = error.'.fugitiveblame' if &shell =~# 'csh' @@ -3563,10 +3557,10 @@ function! s:Blame(bang, line1, line2, count, mods, args) abort else silent! execute '%write !'.basecmd.' > '.temp.' 2> '.error endif - if exists('l:cwd') - execute cd s:fnameescape(cwd) - unlet cwd - endif + finally + execute cdback + endtry + try if v:shell_error call s:throw(join(readfile(error),"\n")) endif @@ -3639,10 +3633,6 @@ function! s:Blame(bang, line1, line2, count, mods, args) abort redraw syncbind endif - finally - if exists('l:cwd') - execute cd s:fnameescape(cwd) - endif endtry return '' catch /^fugitive:/