Eliminate environment juggling in :Gcommit

This commit is contained in:
Tim Pope
2019-06-30 23:24:56 -04:00
parent 74fc4b5eea
commit cf9c04af06

View File

@@ -2681,9 +2681,7 @@ function! s:CommitCommand(line1, line2, range, count, bang, mods, reg, arg, args
endif endif
let cdback = s:Cd(tree) let cdback = s:Cd(tree)
if s:winshell() if s:winshell()
let command = '' let command = 'set GIT_EDITOR=false & '
let old_editor = $GIT_EDITOR
let $GIT_EDITOR = 'false'
else else
let command = 'env GIT_EDITOR=false ' let command = 'env GIT_EDITOR=false '
endif endif
@@ -2743,9 +2741,6 @@ function! s:CommitCommand(line1, line2, range, count, bang, mods, reg, arg, args
catch /^fugitive:/ catch /^fugitive:/
return 'echoerr ' . string(v:exception) return 'echoerr ' . string(v:exception)
finally finally
if exists('old_editor')
let $GIT_EDITOR = old_editor
endif
call delete(outfile) call delete(outfile)
call delete(errorfile) call delete(errorfile)
endtry endtry