Skip to content

Commit

Permalink
fix: fix invalid get() invocation for builtin hooks
Browse files Browse the repository at this point in the history
f37e1a2#diff-8c3e398fc7377f10e5b7c253c3fa3954c027b4cab0960566faae41277f53fa1aL40
removed the get() function and cleaned up most references to it except
for hooks.lua
  • Loading branch information
elsesiy authored and Brian Ryall committed Aug 7, 2024
1 parent 0250182 commit 500629d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lua/git-worktree/hooks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,14 @@ local Path = require('plenary.path')
M.builtins = {
---@type git-worktree.hooks.cb.switch
update_current_buffer_on_switch = function(_, prev_path)
local config = require('git-worktree.config')
if prev_path == nil then
local config = require('git-worktree.config').get()
vim.cmd(config.update_on_change_command)
end

local cwd = vim.loop.cwd()
local current_buf_name = vim.api.nvim_buf_get_name(0)
if not current_buf_name or current_buf_name == '' then
local config = require('git-worktree.config').get()
vim.cmd(config.update_on_change_command)
end

Expand All @@ -79,7 +78,6 @@ M.builtins = {

local start, fin = string.find(name, prev_path, 1, true)
if start == nil then
local config = require('git-worktree.config').get()
vim.cmd(config.update_on_change_command)
end

Expand All @@ -88,7 +86,6 @@ M.builtins = {
local final_path = Path:new({ cwd, local_name }):absolute()

if not Path:new(final_path):exists() then
local config = require('git-worktree.config').get()
vim.cmd(config.update_on_change_command)
end

Expand Down

0 comments on commit 500629d

Please sign in to comment.