From 19067f5b03ff850d782e2a1b69ab63352369c0b4 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Mon, 6 Apr 2026 20:08:47 +0200 Subject: [PATCH] fix: error if git is not installed --- lua/catppuccin/lib/detect_integrations.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lua/catppuccin/lib/detect_integrations.lua b/lua/catppuccin/lib/detect_integrations.lua index 95053e48..fc7900b0 100644 --- a/lua/catppuccin/lib/detect_integrations.lua +++ b/lua/catppuccin/lib/detect_integrations.lua @@ -9,10 +9,16 @@ function M.detect_plugins() local installed_plugins = {} if vim.fn.has "nvim-0.12.0" == 1 then - vim.list_extend( - installed_plugins, - vim.iter(vim.pack.get()):map(function(plugin) return plugin.spec.name end):totable() - ) + -- NOTE: `info = false` prevents vim.pack from trying to use git to get additional info + local ok, plugins = pcall(vim.pack.get, nil, { info = false }) + if not ok then + vim.notify("unable to detect plugins using vim.pack: " .. (plugins or ""), vim.log.levels.WARN) + else + vim.list_extend( + installed_plugins, + vim.iter(plugins):map(function(plugin) return plugin.spec.name end):totable() + ) + end end if pcall(require, "pckr") then vim.list_extend(installed_plugins, require("pckr.plugin").plugins_by_name) end