refactor(git): unify around the Repo abstraction
This commit is contained in:
+3
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user