@@ -5,13 +5,13 @@ local git_utils = require("neo-tree.git.utils")
55local M = {}
66local sep = utils .path_separator
77
8- M . load_ignored_per_directory = function (path )
8+ local load_ignored_per_directory_internal = function (path , pattern )
99 if type (path ) ~= " string" then
1010 log .error (" load_ignored_per_directory: path must be a string" )
1111 return {}
1212 end
1313 local esc_path = vim .fn .shellescape (path )
14- local cmd = string.format (" git -C %s check-ignore %s%s*" , esc_path , esc_path , sep )
14+ local cmd = string.format (" git -C %s check-ignore %s%s*" , esc_path , esc_path , pattern )
1515 local result = vim .fn .systemlist (cmd )
1616 if vim .v .shell_error == 128 then
1717 if type (result ) == " table" then
@@ -37,6 +37,14 @@ M.load_ignored_per_directory = function(path)
3737 return result
3838end
3939
40+ M .load_ignored_per_directory = function (path )
41+ local ignored = load_ignored_per_directory_internal (path , sep )
42+ -- we need to load hidden separately because I can't find a way to get both in one call
43+ local hidden = load_ignored_per_directory_internal (path , sep .. " ." )
44+ vim .list_extend (ignored , hidden )
45+ return ignored
46+ end
47+
4048M .load_ignored = function (path )
4149 local git_root = git_utils .get_repository_root (path )
4250 if not git_root then
0 commit comments