fix(git): prevent execution of git commands when git integration is disabled (#1433)

This commit is contained in:
yehy4
2022-07-19 09:44:05 +02:00
committed by GitHub
parent ecca8118f8
commit 203bb7e176

View File

@@ -68,11 +68,18 @@ function M.get_project_root(cwd)
return nil
end
local project_root = git_utils.get_toplevel(cwd)
return project_root
if M.config.git.enable then
return git_utils.get_toplevel(cwd)
end
return nil
end
local function reload_tree_at(project_root)
if M.config.git.enable then
return nil
end
log.line("watcher", "git event executing '%s'", project_root)
local root_node = utils.get_node_from_path(project_root)
if not root_node then