feat(config): add option allow_access_to_git_ignored_files (#2882)

This commit is contained in:
takuto
2025-12-29 18:41:23 +09:00
committed by GitHub
parent 2ffe820ec1
commit 5cad31db07
2 changed files with 3 additions and 1 deletions

View File

@@ -150,8 +150,9 @@ function M.has_permission_to_access(abs_path)
local config_dir = vim.fn.stdpath("config")
local in_project = abs_path:sub(1, #project_root) == project_root
local in_config = abs_path:sub(1, #config_dir) == config_dir
local bypass_ignore = Config.behaviour and Config.behaviour.allow_access_to_git_ignored_files
if not in_project and not in_config then return false end
return not M.is_ignored(abs_path)
return bypass_ignore or not M.is_ignored(abs_path)
end
---@param path string