mirror of
https://github.com/neovim/neovim.git
synced 2025-12-12 17:42:37 +00:00
fix(pack): show more informative error message if no git executable
Problem: Relaxing minimal Git version did not fully preserve previous
behavior in case there no `git` executable. Instead it showed the same
error as if after `vim.system({ 'does_not_exist' })`.
Solution: Show a more direct "No `git` executable" error message.
This commit is contained in:
@@ -181,11 +181,11 @@ end
|
||||
local git_version = vim.version.parse('1')
|
||||
|
||||
local function git_ensure_exec()
|
||||
local sys_res = vim.system({ 'git', 'version' }):wait()
|
||||
git_version = vim.version.parse(sys_res.stdout)
|
||||
if sys_res.stderr ~= '' then
|
||||
local ok, sys = pcall(vim.system, { 'git', 'version' })
|
||||
if not ok then
|
||||
error('No `git` executable')
|
||||
end
|
||||
git_version = vim.version.parse(sys:wait().stdout)
|
||||
end
|
||||
|
||||
--- @async
|
||||
|
||||
Reference in New Issue
Block a user