fix(explorer.git): better git status watching

This commit is contained in:
Folke Lemaitre 2025-02-05 14:39:44 +01:00
parent 04d4bd7475
commit 09349ecd44
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -15,7 +15,7 @@ M.state = {} ---@type table<string, {tick: number, last: number}>
function M.refresh(path) function M.refresh(path)
for root in pairs(M.state) do for root in pairs(M.state) do
if path == root or path:find(root .. "/", 1, true) == 1 then if path == root or path:find(root .. "/", 1, true) == 1 then
M.state[root] = nil M.state[root].last = 0
end end
end end
end end
@ -26,7 +26,7 @@ function M.is_dirty(cwd)
if not root then if not root then
return false return false
end end
return M.state[root] == nil return M.state[root] == nil or M.state[root].last == 0
end end
---@param cwd string ---@param cwd string