From 2bf70d880e02db95394de360668325b46f804791 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Sat, 8 Mar 2025 22:45:48 +0800 Subject: [PATCH] refactor: add a comment to explain why we skip some paths --- git.yazi/main.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/git.yazi/main.lua b/git.yazi/main.lua index 4f60c76..e1f97bf 100644 --- a/git.yazi/main.lua +++ b/git.yazi/main.lua @@ -29,8 +29,7 @@ local PATTERNS = { local function match(line) local signs = line:sub(1, 2) for _, p in ipairs(PATTERNS) do - local pattern, code = p[1], p[2] - local path + local path, pattern, code = nil, p[1], p[2] if signs:find(pattern) then path = line:sub(4, 4) == '"' and line:sub(5, -2) or line:sub(4) path = WINDOWS and path:gsub("/", "\\") or path @@ -89,6 +88,8 @@ local function propagate_down(excluded, cwd, repo) elseif cwd == repo:join(path):parent() then -- If `path` is a direct subdirectory of `cwd`, mark it as `ignored` new[path] = CODES.ignored + else + -- Skipping, we only care about `cwd` itself and its direct subdirectories for maximum performance end end return new