summaryrefslogtreecommitdiffstats
path: root/lua/conf/plugins/oil.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/conf/plugins/oil.lua')
-rw-r--r--lua/conf/plugins/oil.lua17
1 files changed, 11 insertions, 6 deletions
diff --git a/lua/conf/plugins/oil.lua b/lua/conf/plugins/oil.lua
index d985105..62f452b 100644
--- a/lua/conf/plugins/oil.lua
+++ b/lua/conf/plugins/oil.lua
@@ -6,7 +6,8 @@ local function parse_output(proc)
local result = proc:wait()
local ret = {}
if result.code == 0 then
- for line in vim.gsplit(result.stdout, "\n", { plain = true, trimempty = true }) do
+ for line in vim.gsplit(result.stdout, "\n", {
+ plain = true, trimempty = true }) do
-- Remove trailing slash
line = line:gsub("/$", "")
ret[line] = true
@@ -20,16 +21,20 @@ local function new_git_status()
return setmetatable({}, {
__index = function(self, key)
local ignore_proc = vim.system(
- { "git", "ls-files", "--ignored", "--exclude-standard", "--others", "--directory" },
+ { "git", "ls-files", "--ignored", "--exclude-standard", "--others",
+ "--directory" },
+ {
+ cwd = key,
+ text = true,
+ }
+ )
+ local tracked_proc = vim.system({ "git", "ls-tree", "HEAD",
+ "--name-only" },
{
cwd = key,
text = true,
}
)
- local tracked_proc = vim.system({ "git", "ls-tree", "HEAD", "--name-only" }, {
- cwd = key,
- text = true,
- })
local ret = {
ignored = parse_output(ignore_proc),
tracked = parse_output(tracked_proc),