mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
Ensure nested calls do not overwrite value of original shell.
See #379.
This commit is contained in:
@@ -190,6 +190,7 @@ endfunction
|
||||
|
||||
function! gitgutter#utility#use_known_shell() abort
|
||||
if has('unix')
|
||||
if &shell !=# 'sh'
|
||||
let s:shell = &shell
|
||||
let s:shellcmdflag = &shellcmdflag
|
||||
let s:shellredir = &shellredir
|
||||
@@ -197,6 +198,7 @@ function! gitgutter#utility#use_known_shell() abort
|
||||
set shellcmdflag=-c
|
||||
set shellredir=>%s\ 2>&1
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! gitgutter#utility#restore_shell() abort
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
source helper.vim
|
||||
call Setup()
|
||||
|
||||
set shell=foo
|
||||
|
||||
normal 5Gi*
|
||||
execute 'GitGutterStageHunk'
|
||||
|
||||
call assert_equal('foo', &shell) " NOTE: current test runner ignores v:errors so this line has no effect
|
||||
|
||||
set shell=/bin/bash
|
||||
call DumpSigns('hunkStageSigns')
|
||||
call DumpGitDiffStaged('hunkStageGitDiff')
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
source helper.vim
|
||||
call Setup()
|
||||
|
||||
set shell=foo
|
||||
|
||||
normal 5Gi*
|
||||
execute 'GitGutterUndoHunk'
|
||||
|
||||
call assert_equal('foo', &shell) " NOTE: current test runner ignores v:errors so this line has no effect
|
||||
set shell=/bin/bash
|
||||
call DumpSigns('hunkUndoSigns')
|
||||
call DumpGitDiffStaged('hunkUndoGitDiff')
|
||||
|
||||
Reference in New Issue
Block a user