* should_show_untracked correctly evaluates status.showUntrackedFiles * git.Runner:_run_git_job removes nils before logging args
This commit is contained in:
parent
b314b3a699
commit
09a51266bc
@ -84,7 +84,7 @@ function Runner:_run_git_job()
|
||||
|
||||
local opts = self:_getopts(stdout, stderr)
|
||||
log.line("git", "running job with timeout %dms", self.timeout)
|
||||
log.line("git", "git %s", table.concat(opts.args, " "))
|
||||
log.line("git", "git %s", table.concat(utils.array_remove_nils(opts.args), " "))
|
||||
|
||||
handle, pid = uv.spawn(
|
||||
"git",
|
||||
|
||||
@ -41,7 +41,7 @@ function M.should_show_untracked(cwd)
|
||||
return untracked[cwd]
|
||||
end
|
||||
|
||||
local cmd = "git -C " .. cwd .. " config --type=bool status.showUntrackedFiles"
|
||||
local cmd = "git -C " .. cwd .. " config status.showUntrackedFiles"
|
||||
|
||||
local ps = log.profile_start("git untracked %s", cwd)
|
||||
log.line("git", cmd)
|
||||
@ -51,7 +51,7 @@ function M.should_show_untracked(cwd)
|
||||
log.raw("git", has_untracked)
|
||||
log.profile_end(ps, "git untracked %s", cwd)
|
||||
|
||||
untracked[cwd] = vim.trim(has_untracked) ~= "false"
|
||||
untracked[cwd] = vim.trim(has_untracked) ~= "no"
|
||||
return untracked[cwd]
|
||||
end
|
||||
|
||||
|
||||
@ -408,6 +408,12 @@ function M.array_remove(array, item)
|
||||
end
|
||||
end
|
||||
|
||||
function M.array_remove_nils(array)
|
||||
return vim.tbl_filter(function(v)
|
||||
return v ~= nil
|
||||
end, array)
|
||||
end
|
||||
|
||||
function M.inject_node(f)
|
||||
return function()
|
||||
f(require("nvim-tree.lib").get_node_at_cursor())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user