Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: terrible git status performance in large repo #1519

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lua/neo-tree/git/status.lua
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,11 @@ M.status_async = function(path, base, opts)
args = { "-C", git_root, "diff", "--staged", "--name-status", base, "--" },
enable_recording = false,
maximium_results = context.max_lines,
on_stdout = vim.schedule_wrap(function(err, line, job)
on_stdout = function(err, line, job)
if should_process(err, line, job, "status_async staged error:") then
table.insert(context.lines, line)
end
end),
end,
on_stderr = function(err, line)
if err and err > 0 then
log.error("status_async staged error: ", err, line)
Expand All @@ -272,14 +272,14 @@ M.status_async = function(path, base, opts)
args = { "-C", git_root, "diff", "--name-status" },
enable_recording = false,
maximium_results = context.max_lines,
on_stdout = vim.schedule_wrap(function(err, line, job)
on_stdout = function(err, line, job)
if should_process(err, line, job, "status_async unstaged error:") then
if line then
line = " " .. line
end
table.insert(context.lines, line)
end
end),
end,
on_stderr = function(err, line)
if err and err > 0 then
log.error("status_async unstaged error: ", err, line)
Expand All @@ -292,14 +292,14 @@ M.status_async = function(path, base, opts)
args = { "-C", git_root, "ls-files", "--exclude-standard", "--others" },
enable_recording = false,
maximium_results = context.max_lines,
on_stdout = vim.schedule_wrap(function(err, line, job)
on_stdout = function(err, line, job)
if should_process(err, line, job, "status_async untracked error:") then
if line then
line = "? " .. line
end
table.insert(context.lines, line)
end
end),
end,
on_stderr = function(err, line)
if err and err > 0 then
log.error("status_async untracked error: ", err, line)
Expand Down