refactor(git): extract repo.resolve_cwd helper
This commit is contained in:
+1
-5
@@ -6,11 +6,7 @@ local M = {}
|
||||
---@param opts { amend: boolean? }?
|
||||
function M.commit(opts)
|
||||
local amend = opts and opts.amend or false
|
||||
local path = vim.api.nvim_buf_get_name(0)
|
||||
if path == "" then
|
||||
path = vim.fn.getcwd()
|
||||
end
|
||||
local gitdir, worktree = repo.resolve(path)
|
||||
local gitdir, worktree = repo.resolve_cwd()
|
||||
if not gitdir or not worktree then
|
||||
log.warning("not in a git repository")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user