Skip to content

Commit

Permalink
Use 'sh' as shell instead of configurable '/bin/sh'.
Browse files Browse the repository at this point in the history
sh isn't always at /bin/sh, e.g. on Android or Termux, but it is always
on the path.

See airblade#360.
  • Loading branch information
airblade committed Sep 30, 2016
1 parent 402257f commit 4f9c5b0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions autoload/gitgutter/async.vim
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function! gitgutter#async#execute(cmd) abort

if has('nvim')
if has('unix')
let command = [g:gitgutter_sh, "-c", a:cmd]
let command = ["sh", "-c", a:cmd]
elseif has('win32')
let command = ["cmd.exe", "/c", a:cmd]
else
Expand Down Expand Up @@ -55,7 +55,7 @@ function! gitgutter#async#execute(cmd) abort
" only occurs when a file is not tracked by git).

if has('unix')
let command = [g:gitgutter_sh, "-c", a:cmd]
let command = ["sh", "-c", a:cmd]
elseif has('win32')
" Help docs recommend {command} be a string on Windows. But I think
" they also say that will run the command directly, which I believe would
Expand Down
2 changes: 1 addition & 1 deletion autoload/gitgutter/utility.vim
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ function! gitgutter#utility#use_known_shell() abort
let s:shell = &shell
let s:shellcmdflag = &shellcmdflag
let s:shellredir = &shellredir
let &shell = g:gitgutter_sh
let &shell = 'sh'
set shellcmdflag=-c
set shellredir=>%s\ 2>&1
endif
Expand Down
1 change: 0 additions & 1 deletion plugin/gitgutter.vim
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ call s:set('g:gitgutter_avoid_cmd_prompt_on_windows', 1)
call s:set('g:gitgutter_async', 1)
call s:set('g:gitgutter_log', 0)
call s:set('g:gitgutter_git_executable', 'git')
call s:set('g:gitgutter_sh', '/bin/sh')

if !executable(g:gitgutter_git_executable)
call gitgutter#utility#warn('cannot find git. Please set g:gitgutter_git_executable.')
Expand Down

0 comments on commit 4f9c5b0

Please sign in to comment.