From ceb18eeceb1b7b89015b9e7adc3739edb6393f12 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Fri, 7 Oct 2011 01:32:46 -0400 Subject: [PATCH] Fix issue with symlinked tmp dir --- plugin/fugitive.vim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index be4f4c9..fb6c960 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -979,7 +979,7 @@ function! s:Edit(cmd,bang,...) abort diffupdate return 'redraw|echo '.string(':!'.git.' '.args) else - let temp = tempname() + let temp = resolve(tempname()) let s:temp_files[temp] = s:repo().dir() silent execute a:cmd.' '.temp if a:cmd =~# 'pedit' @@ -1446,7 +1446,7 @@ function! s:Blame(bang,line1,line2,count,args) abort if a:count execute 'write !'.substitute(basecmd,' blame ',' blame -L '.a:line1.','.a:line2.' ','g') else - let error = tempname() + let error = resolve(tempname()) let temp = error.'.fugitiveblame' if &shell =~# 'csh' silent! execute '%write !('.basecmd.' > '.temp.') >& '.error @@ -2053,7 +2053,9 @@ augroup END " }}}1 " Temp files {{{1 -let s:temp_files = {} +if !exists('s:temp_files') + let s:temp_files = {} +endif augroup fugitive_temp autocmd!