Ensure nested calls do not overwrite value of original shell.

See #379.
This commit is contained in:
Andy Stewart
2016-10-19 10:00:11 +01:00
parent b1734a3916
commit a693c0d326
3 changed files with 19 additions and 6 deletions

View File

@@ -190,12 +190,14 @@ endfunction
function! gitgutter#utility#use_known_shell() abort
if has('unix')
let s:shell = &shell
let s:shellcmdflag = &shellcmdflag
let s:shellredir = &shellredir
let &shell = 'sh'
set shellcmdflag=-c
set shellredir=>%s\ 2>&1
if &shell !=# 'sh'
let s:shell = &shell
let s:shellcmdflag = &shellcmdflag
let s:shellredir = &shellredir
let &shell = 'sh'
set shellcmdflag=-c
set shellredir=>%s\ 2>&1
endif
endif
endfunction