refactor(git): extract repo.resolve_cwd helper

This commit is contained in:
2026-04-27 13:41:39 +02:00
parent 4b8d551b0d
commit b4c166e86c
5 changed files with 17 additions and 20 deletions
+1 -5
View File
@@ -842,11 +842,7 @@ function M.toggle()
vim.api.nvim_win_close(sidebar_win, false)
return
end
local path = vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf())
if path == "" then
path = vim.fn.getcwd()
end
local _, worktree = repo.resolve(path)
local _, worktree = repo.resolve_cwd()
if not worktree then
log.warning("not in a git repository")
return