Skip to content

Commit

Permalink
feat: Pass worktree_path to Create hook ThePrimeagen#103
Browse files Browse the repository at this point in the history
  • Loading branch information
jokajak committed Dec 14, 2022
2 parents dd3c09e + 99b2ae6 commit 7899610
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/git-worktree/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -377,15 +377,15 @@ local function create_worktree(path, branch, upstream, found_branch)
end

vim.schedule(function()
emit_on_change(Enum.Operations.Create, {path = path, branch = branch, upstream = upstream})
M.switch_worktree(path)
emit_on_change(Enum.Operations.Create, {path = worktree_path, branch = branch, upstream = upstream})
M.switch_worktree(worktree_path)
end)
end)
else
create:after(function()
vim.schedule(function()
emit_on_change(Enum.Operations.Create, {path = path, branch = branch, upstream = upstream})
M.switch_worktree(path)
emit_on_change(Enum.Operations.Create, {path = worktree_path, branch = branch, upstream = upstream})
M.switch_worktree(worktree_path)
end)
end)
end
Expand Down

0 comments on commit 7899610

Please sign in to comment.