refactor(git): make the git module self-contained under git.util
This commit is contained in:
+3
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user