@@ -2,6 +2,7 @@ local log = require "nvim-tree.log"
2
2
local utils = require " nvim-tree.utils"
3
3
local git_utils = require " nvim-tree.git.utils"
4
4
local Runner = require " nvim-tree.git.runner"
5
+ local Watch = require " nvim-tree.explorer.watch"
5
6
local Watcher = require (" nvim-tree.watcher" ).Watcher
6
7
local Iterator = require " nvim-tree.iterators.node-iterator"
7
8
local explorer_node = require " nvim-tree.explorer.node"
@@ -143,12 +144,13 @@ function M.load_project_status(cwd)
143
144
timeout = M .config .git .timeout ,
144
145
}
145
146
146
- local git_directory = git_utils .get_git_directory (project_root )
147
-
148
147
local watcher = nil
148
+
149
149
if M .config .filesystem_watchers .enable then
150
150
log .line (" watcher" , " git start" )
151
151
152
+ local git_directory = git_utils .get_git_directory (project_root )
153
+
152
154
if git_directory == nil then
153
155
log .line (" watcher" , " could not found the location of .git folder" )
154
156
else
@@ -162,9 +164,10 @@ function M.load_project_status(cwd)
162
164
end )
163
165
end
164
166
165
- -- Add $GIT_DIR to the list of directory to ignore
166
- local base_gitdir = utils .path_basename (git_directory )
167
- table.insert (M .config .filesystem_watchers .ignore_dirs , base_gitdir )
167
+ -- Add GIT_DIR to the list of directory to ignore
168
+ -- local base_gitdir = utils.path_basename(git_directory)
169
+ -- Watch.ignore_dir(base_gitdir)
170
+ Watch .ignore_dir (git_directory )
168
171
169
172
watcher = Watcher :new (git_directory , WATCHED_FILES , callback , {
170
173
project_root = project_root ,
0 commit comments