When git cannot be found only warn if plugin enabled

This enables the plugin to be loaded on systems without git, without
emitting any warnings.

See #702.
This commit is contained in:
Andy Stewart
2020-04-27 14:09:56 +01:00
parent 011fca3f02
commit a194e9da01

View File

@@ -69,7 +69,9 @@ call s:set('g:gitgutter_use_location_list', 0)
call s:set('g:gitgutter_git_executable', 'git')
if !executable(g:gitgutter_git_executable)
call gitgutter#utility#warn('cannot find git. Please set g:gitgutter_git_executable.')
if g:gitgutter_enabled
call gitgutter#utility#warn('cannot find git. Please set g:gitgutter_git_executable.')
endif
endif
let default_grep = 'grep'