mirror of
https://github.com/neovim/neovim.git
synced 2025-12-10 16:42:42 +00:00
fix(health): git check and autocmd clean #36713
Problem: Incorrect Git check and improper autocmd cleanup Solution: Add once to the autocmd and fix the Git check condition
This commit is contained in:
@@ -533,13 +533,13 @@ local function check_sysinfo()
|
|||||||
local version_for_report = nvim_version
|
local version_for_report = nvim_version
|
||||||
if commit_hash then
|
if commit_hash then
|
||||||
version_for_report = nvim_version:gsub('%+g' .. commit_hash, ' neovim/neovim@' .. commit_hash)
|
version_for_report = nvim_version:gsub('%+g' .. commit_hash, ' neovim/neovim@' .. commit_hash)
|
||||||
local has_git = vim.fn.executable('git') == 0
|
local has_git = vim.fn.executable('git') == 1
|
||||||
local has_curl = vim.fn.executable('curl') == 1
|
local has_curl = vim.fn.executable('curl') == 1
|
||||||
local cmd = has_git and { 'git', 'ls-remote', 'https://github.com/neovim/neovim', 'nightly' }
|
local cmd = has_git and { 'git', 'ls-remote', 'https://github.com/neovim/neovim', 'HEAD' }
|
||||||
or has_curl and {
|
or has_curl and {
|
||||||
'curl',
|
'curl',
|
||||||
'-s',
|
'-s',
|
||||||
'https://api.github.com/repos/neovim/neovim/commits/nightly',
|
'https://api.github.com/repos/neovim/neovim/commits/master',
|
||||||
'-H',
|
'-H',
|
||||||
'Accept: application/vnd.github.sha',
|
'Accept: application/vnd.github.sha',
|
||||||
}
|
}
|
||||||
@@ -633,6 +633,7 @@ local function check_sysinfo()
|
|||||||
'%#WarningMsg#%@v:lua.nvim_health_bugreport_open@Click to Create Bug Report on GitHub%X%*'
|
'%#WarningMsg#%@v:lua.nvim_health_bugreport_open@Click to Create Bug Report on GitHub%X%*'
|
||||||
vim.api.nvim_create_autocmd('BufDelete', {
|
vim.api.nvim_create_autocmd('BufDelete', {
|
||||||
buffer = buf,
|
buffer = buf,
|
||||||
|
once = true,
|
||||||
command = 'lua _G.nvim_health_bugreport_open = nil',
|
command = 'lua _G.nvim_health_bugreport_open = nil',
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user