We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f0341c commit 45c0cbbCopy full SHA for 45c0cbb
lua/neogit/popups/worktree/actions.lua
@@ -129,8 +129,9 @@ function M.delete()
129
local success = false
130
131
if input.get_permission(("Remove worktree at %q?"):format(selected)) then
132
- if change_dir and status.is_open() then
133
- status.instance():chdir(git.worktree.main().path)
+ local main = git.worktree.main() -- A bare repo has no main, so check
+ if change_dir and status.is_open() and main then
134
+ status.instance():chdir(main.path)
135
end
136
137
-- This might produce some error messages that need to get suppressed
0 commit comments