Tweak check for Git in PATH

First attempt was overthinking it.
This commit is contained in:
Tim Pope
2021-08-19 13:23:20 -04:00
parent 9ba2680ad5
commit 952a49f688

View File

@@ -92,7 +92,7 @@ function! s:VersionCheck() abort
return 'return ' . string('echoerr "fugitive: Vim 7.4 or newer required"') return 'return ' . string('echoerr "fugitive: Vim 7.4 or newer required"')
elseif empty(fugitive#GitVersion()) elseif empty(fugitive#GitVersion())
let exe = get(s:GitCmd(), 0, '') let exe = get(s:GitCmd(), 0, '')
if exists('*exepath') && len(exe) && empty(exepath(exe)) if len(exe) && !executable(exe)
return 'return ' . string('echoerr "fugitive: cannot find ' . string(exe) . ' in PATH"') return 'return ' . string('echoerr "fugitive: cannot find ' . string(exe) . ' in PATH"')
endif endif
return 'return ' . string('echoerr "fugitive: cannot execute Git"') return 'return ' . string('echoerr "fugitive: cannot execute Git"')