From 4f9c5b0f3e2a20081edc1ec60a79640f7d55e3e0 Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Fri, 30 Sep 2016 10:28:29 +0100 Subject: [PATCH] Use 'sh' as shell instead of configurable '/bin/sh'. sh isn't always at /bin/sh, e.g. on Android or Termux, but it is always on the path. See #360. --- autoload/gitgutter/async.vim | 4 ++-- autoload/gitgutter/utility.vim | 2 +- plugin/gitgutter.vim | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/autoload/gitgutter/async.vim b/autoload/gitgutter/async.vim index 2938126..55baf3a 100644 --- a/autoload/gitgutter/async.vim +++ b/autoload/gitgutter/async.vim @@ -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 @@ -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 diff --git a/autoload/gitgutter/utility.vim b/autoload/gitgutter/utility.vim index 6caa0b3..0888a73 100644 --- a/autoload/gitgutter/utility.vim +++ b/autoload/gitgutter/utility.vim @@ -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 diff --git a/plugin/gitgutter.vim b/plugin/gitgutter.vim index b29bf25..ff87a0a 100644 --- a/plugin/gitgutter.vim +++ b/plugin/gitgutter.vim @@ -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.')