feat(builtin.git_status): convert to async finder
Avoids timeout issues in large git repos.
This commit is contained in:
@@ -367,26 +367,12 @@ git.status = function(opts)
|
|||||||
|
|
||||||
local gen_new_finder = function()
|
local gen_new_finder = function()
|
||||||
local expand_dir = vim.F.if_nil(opts.expand_dir, true)
|
local expand_dir = vim.F.if_nil(opts.expand_dir, true)
|
||||||
local git_cmd = git_command({ "status", "-z", "--", "." }, opts)
|
local git_cmd = git_command({ "status", "--porcelain=v1", "--", "." }, opts)
|
||||||
|
|
||||||
if expand_dir then
|
if expand_dir then
|
||||||
table.insert(git_cmd, #git_cmd - 1, "-u")
|
table.insert(git_cmd, #git_cmd - 1, "-u")
|
||||||
end
|
end
|
||||||
|
opts.entry_maker = vim.F.if_nil(opts.entry_maker, make_entry.gen_from_git_status(opts))
|
||||||
local output = utils.get_os_command_output(git_cmd, opts.cwd)
|
return finders.new_oneshot_job(git_cmd, opts)
|
||||||
|
|
||||||
if #output == 0 then
|
|
||||||
utils.notify("builtin.git_status", {
|
|
||||||
msg = "No changes found",
|
|
||||||
level = "WARN",
|
|
||||||
})
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
return finders.new_table {
|
|
||||||
results = vim.split(output[1], " | |||||||