refactor(git): make the git module self-contained under git.util

This commit is contained in:
2026-04-28 09:05:01 +02:00
parent 4390b55dfe
commit 37e5582795
10 changed files with 195 additions and 75 deletions
+3 -4
View File
@@ -1,8 +1,7 @@
local diff = require("git.diff")
local git = require("git")
local log = require("log")
local repo = require("git.repo")
local util = require("util")
local util = require("git.util")
local M = {}
@@ -109,7 +108,7 @@ end
---@param section ow.Git.DiffSection
local function show_diff(ctx, section)
if not section.pre_blob or not section.post_blob then
log.warning("no index line; cannot determine blob SHAs")
util.warning("no index line; cannot determine blob SHAs")
return
end
local parent = ctx.parent_ref or "0"
@@ -152,7 +151,7 @@ function M.open_commit(worktree, ref, opts)
return
end
local stdout = util.system_sync({ "git", "show", ref }, { cwd = worktree })
local stdout = util.exec({ "git", "show", ref }, { cwd = worktree })
if not stdout then
return
end