From 9ba2680ad58a55a45da2e41d6b1ebe65026b04c8 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 17 Aug 2021 22:28:01 -0400 Subject: [PATCH] Add special case error for failure to find Git in PATH --- autoload/fugitive.vim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 1c3664b..b40a97f 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -91,6 +91,10 @@ function! s:VersionCheck() abort if v:version < 704 return 'return ' . string('echoerr "fugitive: Vim 7.4 or newer required"') elseif empty(fugitive#GitVersion()) + let exe = get(s:GitCmd(), 0, '') + if exists('*exepath') && len(exe) && empty(exepath(exe)) + return 'return ' . string('echoerr "fugitive: cannot find ' . string(exe) . ' in PATH"') + endif return 'return ' . string('echoerr "fugitive: cannot execute Git"') elseif !fugitive#GitVersion(1, 8, 5) return 'return ' . string('echoerr "fugitive: Git 1.8.5 or newer required"')