refactor(git): split status code parsing into status.lua

This commit is contained in:
2026-04-30 17:24:11 +02:00
parent 9f44c9de40
commit eebe191371
4 changed files with 57 additions and 52 deletions
+2 -11
View File
@@ -1,18 +1,9 @@
local repo = require("git.repo")
local status = require("git.status")
local util = require("git.util")
local M = {}
---@param code string
---@return string?
local function format(code)
local char, hl = repo.indicator(code)
if not char then
return nil
end
return string.format("%%#%s#%s%%*", hl, char)
end
---@class ow.Git.Repo
---@field gitdir string
---@field worktree string
@@ -89,7 +80,7 @@ local function do_refresh(r)
end
end
statuses[vim.fs.joinpath(r.worktree, path_part)] =
format(code)
status.format(code)
end
end
else