fix: avante.llm_tools.helpers.is_ignored error (#2895)

This commit is contained in:
Waitzz
2025-12-29 17:30:11 +08:00
committed by GitHub
parent a9e9890fc6
commit 2ffe820ec1

View File

@@ -129,9 +129,7 @@ end
---@return boolean
function M.is_ignored(abs_path)
local project_root = Utils.get_project_root()
local exit_code = vim
.system({ "git", "-C", vim.fn.shellescape(project_root), "check-ignore", vim.fn.shellescape(abs_path) }, { text = true })
:wait().code
local exit_code = vim.system({ "git", "-C", project_root, "check-ignore", abs_path }, { text = true }):wait().code
-- If command failed or git is not available or not a git repository, fall back to old method
if exit_code ~= 0 and exit_code ~= 1 then return old_is_ignored(abs_path) end