fix(vim.pack): skip checkout on bad version #36038

Refs: #36037
This commit is contained in:
Mickaël RAYBAUD-ROIG
2025-10-09 22:40:26 +02:00
committed by GitHub
parent 4598305e0b
commit 8e740db70c
2 changed files with 11 additions and 1 deletions

View File

@@ -583,6 +583,16 @@ describe('vim.pack', function()
eq(false, vim.tbl_contains(rtp, after_dir))
end)
it('does not checkout on bad `version`', function()
local err = pcall_err(exec_lua, function()
vim.pack.add({ { src = repos_src.basic, version = 'not-exist' } })
end)
matches('`not%-exist` is not a branch/tag/commit', err)
local plug_path = pack_get_plug_path('basic')
local entries = vim.iter(vim.fs.dir(plug_path)):totable()
eq({ { '.git', 'directory' } }, entries)
end)
it('can install from the Internet', function()
t.skip(skip_integ, 'NVIM_TEST_INTEG not set: skipping network integration test')
exec_lua(function()