Skip to content

Commit

Permalink
Pass worktree_path to Create hook
Browse files Browse the repository at this point in the history
  • Loading branch information
halfdan committed Oct 19, 2022
1 parent d7f4e25 commit e1ac13f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/git-worktree/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,14 @@ 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})
emit_on_change(Enum.Operations.Create, {path = worktree_path, branch = branch, upstream = upstream})
M.switch_worktree(path)
end)
end)
else
create:after(function()
vim.schedule(function()
emit_on_change(Enum.Operations.Create, {path = path, branch = branch, upstream = upstream})
emit_on_change(Enum.Operations.Create, {path = worktree_path, branch = branch, upstream = upstream})
M.switch_worktree(path)
end)
end)
Expand Down

0 comments on commit e1ac13f

Please sign in to comment.