Hack around broken :Gcommit with symlinked .git

This commit is contained in:
Tim Pope 2012-03-03 03:22:48 -05:00
parent da2aebe3e6
commit 22c8ffa2ba

View File

@ -779,7 +779,8 @@ function! s:Commit(args) abort
let outfile = tempname()
let errorfile = tempname()
try
execute cd.'`=s:repo().tree()`'
try
execute cd.s:fnameescape(s:repo().tree())
if &shell =~# 'cmd'
let command = ''
let old_editor = $GIT_EDITOR
@ -795,6 +796,9 @@ function! s:Commit(args) abort
else
silent execute '!'.command.' > '.outfile.' 2> '.errorfile
endif
finally
execute cd.'`=dir`'
endtry
if !has('gui_running')
redraw!
endif
@ -827,7 +831,7 @@ function! s:Commit(args) abort
execute 'keepalt split '.s:fnameescape(msgfile)
endif
let b:fugitive_commit_arguments = args
setlocal bufhidden=delete filetype=gitcommit
setlocal bufhidden=wipe filetype=gitcommit
return '1'
elseif error ==# '!'
return s:Status()
@ -843,7 +847,6 @@ function! s:Commit(args) abort
endif
call delete(outfile)
call delete(errorfile)
execute cd.'`=dir`'
call fugitive#reload_status()
endtry
endfunction