fix(git): prevent execution of git commands when git integration is disabled (#1433)
This commit is contained in:
@@ -68,11 +68,18 @@ function M.get_project_root(cwd)
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
local project_root = git_utils.get_toplevel(cwd)
|
if M.config.git.enable then
|
||||||
return project_root
|
return git_utils.get_toplevel(cwd)
|
||||||
|
end
|
||||||
|
|
||||||
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
local function reload_tree_at(project_root)
|
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)
|
log.line("watcher", "git event executing '%s'", project_root)
|
||||||
local root_node = utils.get_node_from_path(project_root)
|
local root_node = utils.get_node_from_path(project_root)
|
||||||
if not root_node then
|
if not root_node then
|
||||||
|
|||||||
Reference in New Issue
Block a user