refactor: add a comment to explain why we skip some paths
This commit is contained in:
@@ -29,8 +29,7 @@ local PATTERNS = {
|
|||||||
local function match(line)
|
local function match(line)
|
||||||
local signs = line:sub(1, 2)
|
local signs = line:sub(1, 2)
|
||||||
for _, p in ipairs(PATTERNS) do
|
for _, p in ipairs(PATTERNS) do
|
||||||
local pattern, code = p[1], p[2]
|
local path, pattern, code = nil, p[1], p[2]
|
||||||
local path
|
|
||||||
if signs:find(pattern) then
|
if signs:find(pattern) then
|
||||||
path = line:sub(4, 4) == '"' and line:sub(5, -2) or line:sub(4)
|
path = line:sub(4, 4) == '"' and line:sub(5, -2) or line:sub(4)
|
||||||
path = WINDOWS and path:gsub("/", "\\") or path
|
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
|
elseif cwd == repo:join(path):parent() then
|
||||||
-- If `path` is a direct subdirectory of `cwd`, mark it as `ignored`
|
-- If `path` is a direct subdirectory of `cwd`, mark it as `ignored`
|
||||||
new[path] = CODES.ignored
|
new[path] = CODES.ignored
|
||||||
|
else
|
||||||
|
-- Skipping, we only care about `cwd` itself and its direct subdirectories for maximum performance
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return new
|
return new
|
||||||
|
|||||||
Reference in New Issue
Block a user