refactor(git): unify around the Repo abstraction

This commit is contained in:
2026-05-02 22:45:44 +02:00
parent 8bd674622e
commit be1d7ace50
14 changed files with 671 additions and 586 deletions
+3 -3
View File
@@ -7,8 +7,8 @@ local M = {}
---@param opts { amend: boolean? }?
function M.commit(opts)
local amend = opts and opts.amend or false
local _, worktree = repo.current_repo()
if not worktree then
local r = repo.find()
if not r then
util.warning("not in a git repository")
return
end
@@ -19,7 +19,7 @@ function M.commit(opts)
end
local proxy_buf, proxy_win
editor.run(cmd, { cwd = worktree }, function(file_path, done)
editor.run(cmd, { cwd = r.worktree }, function(file_path, done)
local lines = {}
local f = io.open(file_path, "r")
if f then