refactor(git/status): rework entries into typed variants on porcelain v2

This commit is contained in:
2026-05-09 22:59:07 +02:00
parent a7932bab5a
commit 067594ef9e
9 changed files with 793 additions and 292 deletions
+9 -10
View File
@@ -651,17 +651,16 @@ end
---@return string[]
local function complete_unstaged_paths(r, lead)
local matches = {}
for path, entry_list in pairs(r.status.entries) do
for path, entry in pairs(r.status.entries) do
if path:sub(1, #lead) == lead then
for _, e in ipairs(entry_list) do
if
e.kind == "unstaged"
or e.kind == "untracked"
or e.kind == "unmerged"
then
table.insert(matches, path)
break
end
local include = entry.kind == "untracked"
or entry.kind == "unmerged"
if not include and entry.kind == "changed" then
---@cast entry ow.Git.Status.ChangedEntry
include = entry.unstaged ~= nil
end
if include then
table.insert(matches, path)
end
end
end