Skip to content

Commit

Permalink
Add test for not clobbering v:shell_error
Browse files Browse the repository at this point in the history
  • Loading branch information
airblade committed Sep 1, 2023
1 parent 101e9ca commit 744a0fc
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/test_gitgutter.vim
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,27 @@ function Test_file_unknown_in_base()
endfunction


function Test_v_shell_error_not_clobbered()
" set gitgutter up to generate a shell error
let starting_branch = split(system('git branch --show-current'))[0]
call system('git checkout -b some-feature')
let tmp = 'file-on-this-branch-only.tmp'
call system('echo "hi" > '.tmp.' && git add '.tmp)
execute 'edit '.tmp
let g:gitgutter_diff_base = starting_branch

" run a successful shell command
silent !echo foobar >/dev/null

" run gitgutter
GitGutter

call assert_equal(0, v:shell_error)

let g:gitgutter_diff_base = ''
endfunction


function Test_hunk_outside_noop()
5
GitGutterStageHunk
Expand Down

0 comments on commit 744a0fc

Please sign in to comment.