Skip to content

Commit

Permalink
fix: Close prompt only if worktree_path is not nil in switch_worktree
Browse files Browse the repository at this point in the history
  • Loading branch information
rbmarliere committed Sep 21, 2024
1 parent fe4c077 commit 314e334
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/telescope/_extensions/git_worktree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ end
-- @return nil
local switch_worktree = function(prompt_bufnr)
local worktree_path = get_worktree_path(prompt_bufnr)
actions.close(prompt_bufnr)
if worktree_path == nil then
vim.print('No worktree selected')
return
end
actions.close(prompt_bufnr)
git_worktree.switch_worktree(worktree_path)
end

Expand Down

0 comments on commit 314e334

Please sign in to comment.