@@ -48,36 +48,29 @@ local get_root_for_item = function(item)
48
48
end
49
49
50
50
M .mark_ignored = function (state , items )
51
- local git_roots = {}
51
+ local folders = {}
52
52
log .trace (" ================================================================================" )
53
53
log .trace (" IGNORED: mark_ignore BEGIN..." )
54
54
for _ , item in ipairs (items ) do
55
- local root = get_root_for_item (item )
56
- if root then
57
- if not git_roots [ root ] then
58
- git_roots [ root ] = {}
55
+ local folder = utils . split_path (item . path )
56
+ if folder then
57
+ if not folders [ folder ] then
58
+ folders [ folder ] = {}
59
59
end
60
- table.insert (git_roots [ root ], item .path )
60
+ table.insert (folders [ folder ], item .path )
61
61
end
62
62
end
63
63
64
64
local all_results = {}
65
- for repo_root , repo_items in pairs (git_roots ) do
66
- local cmd = {" git" , " -C" , repo_root , " check-ignore" }
67
- for _ , item in ipairs (repo_items ) do
65
+ for folder , folder_items in pairs (folders ) do
66
+ local cmd = {" git" , " -C" , folder , " check-ignore" }
67
+ for _ , item in ipairs (folder_items ) do
68
68
table.insert (cmd , item )
69
69
end
70
70
log .trace (" IGNORED: Running cmd: " , cmd )
71
71
local result = vim .fn .systemlist (cmd )
72
72
if vim .v .shell_error == 128 then
73
- if type (result ) == " table" then
74
- if vim .startswith (result [1 ], " fatal:" ) then
75
- -- These errors are all about not being in a repository
76
- log .error (" Error in git.mark_ignored: " , result [1 ])
77
- result = {}
78
- end
79
- end
80
- log .error (" Failed to load ignored files for" , state .path , " :" , result )
73
+ log .debug (" Failed to load ignored files for" , state .path , " :" , result )
81
74
result = {}
82
75
end
83
76
0 commit comments