Skip to content

Commit 54b5f25

Browse files
committed
refactor: cleanup load_ignored params, part of #226
1 parent 67c4fb6 commit 54b5f25

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lua/neo-tree/git/ignored.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ local load_ignored_per_directory_internal = function(path, pattern)
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, pattern)
14+
local cmd = string.format("git -C %s check-ignore %s%s%s", esc_path, esc_path, sep, pattern)
1515
local result = vim.fn.systemlist(cmd)
1616
if vim.v.shell_error == 128 then
1717
if type(result) == "table" then
@@ -38,9 +38,9 @@ local load_ignored_per_directory_internal = function(path, pattern)
3838
end
3939

4040
M.load_ignored_per_directory = function(path)
41-
local ignored = load_ignored_per_directory_internal(path, sep)
41+
local ignored = load_ignored_per_directory_internal(path, "*")
4242
-- 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 .. ".")
43+
local hidden = load_ignored_per_directory_internal(path, ".*")
4444
vim.list_extend(ignored, hidden)
4545
return ignored
4646
end

0 commit comments

Comments
 (0)