@@ -144,7 +144,7 @@ M.status = function(base, exclude_directories, path)
144144 git_root = git_root ,
145145 git_status = {},
146146 exclude_directories = exclude_directories ,
147- lines_parsed = 0
147+ lines_parsed = 0 ,
148148 }
149149
150150 for _ , line in ipairs (staged_result ) do
@@ -232,7 +232,7 @@ M.status_async = function(path, base, opts)
232232 return true
233233 end
234234
235- local job_complete_callback = function ()
235+ local job_complete_callback = function ()
236236 utils .debounce (event_id , nil , nil , nil , utils .debounce_action .COMPLETE_ASYNC_JOB )
237237 vim .schedule (function ()
238238 events .fire_event (events .GIT_STATUS_CHANGED , {
@@ -247,67 +247,65 @@ M.status_async = function(path, base, opts)
247247 end )
248248
249249 utils .debounce (event_id , function ()
250- local staged_job = Job
251- :new ({
252- command = " git" ,
253- args = { " -C" , git_root , " diff" , " --staged" , " --name-status" , base , " --" },
254- enable_recording = false ,
255- maximium_results = context .max_lines ,
256- on_stdout = vim .schedule_wrap (function (err , line , job )
257- if should_process (err , line , job , " status_async staged error:" ) then
258- table.insert (context .lines , line )
259- end
260- end ),
261- on_stderr = function (err , line )
262- if err and err > 0 then
263- log .error (" status_async staged error: " , err , line )
264- end
265- end ,
266- })
250+ local staged_job = Job :new ({
251+ command = " git" ,
252+ args = { " -C" , git_root , " diff" , " --staged" , " --name-status" , base , " --" },
253+ enable_recording = false ,
254+ maximium_results = context .max_lines ,
255+ on_stdout = vim .schedule_wrap (function (err , line , job )
256+ if should_process (err , line , job , " status_async staged error:" ) then
257+ table.insert (context .lines , line )
258+ end
259+ end ),
260+ on_stderr = function (err , line )
261+ if err and err > 0 then
262+ log .error (" status_async staged error: " , err , line )
263+ end
264+ end ,
265+ })
267266
268- local unstaged_job = Job
269- :new ({
270- command = " git" ,
271- args = { " -C" , git_root , " diff" , " --name-status" },
272- enable_recording = false ,
273- maximium_results = context .max_lines ,
274- on_stdout = vim .schedule_wrap (function (err , line , job )
275- if should_process (err , line , job , " status_async unstaged error:" ) then
276- if line then
277- line = " " .. line
278- end
279- table.insert (context .lines , line )
267+ local unstaged_job = Job :new ({
268+ command = " git" ,
269+ args = { " -C" , git_root , " diff" , " --name-status" },
270+ enable_recording = false ,
271+ maximium_results = context .max_lines ,
272+ on_stdout = vim .schedule_wrap (function (err , line , job )
273+ if should_process (err , line , job , " status_async unstaged error:" ) then
274+ if line then
275+ line = " " .. line
280276 end
281- end ),
282- on_stderr = function (err , line )
283- if err and err > 0 then
284- log .error (" status_async unstaged error: " , err , line )
285- end
286- end ,
287- })
277+ table.insert (context .lines , line )
278+ end
279+ end ),
280+ on_stderr = function (err , line )
281+ if err and err > 0 then
282+ log .error (" status_async unstaged error: " , err , line )
283+ end
284+ end ,
285+ })
288286
289- local untracked_job = Job
290- :new ({
291- command = " git" ,
292- args = { " -C" , git_root , " ls-files" , " --exclude-standard" , " --others" },
293- enable_recording = false ,
294- maximium_results = context .max_lines ,
295- on_stdout = vim .schedule_wrap (function (err , line , job )
296- if should_process (err , line , job , " status_async untracked error:" ) then
297- if line then
298- line = " ? " .. line
299- end
300- table.insert (context .lines , line )
287+ local untracked_job = Job :new ({
288+ command = " git" ,
289+ args = { " -C" , git_root , " ls-files" , " --exclude-standard" , " --others" },
290+ enable_recording = false ,
291+ maximium_results = context .max_lines ,
292+ on_stdout = vim .schedule_wrap (function (err , line , job )
293+ if should_process (err , line , job , " status_async untracked error:" ) then
294+ if line then
295+ line = " ? " .. line
301296 end
302- end ),
303- on_stderr = function (err , line )
304- if err and err > 0 then
305- log .error (" status_async untracked error: " , err , line )
306- end
307- end ,
308- })
297+ table.insert (context .lines , line )
298+ end
299+ end ),
300+ on_stderr = function (err , line )
301+ if err and err > 0 then
302+ log .error (" status_async untracked error: " , err , line )
303+ end
304+ end ,
305+ })
309306
310- local showUntracked = vim .fn .systemlist ({" git" , " -C" , git_root , " config" , " --get" , " status.showUntrackedFiles" })
307+ local showUntracked =
308+ vim .fn .systemlist ({ " git" , " -C" , git_root , " config" , " --get" , " status.showUntrackedFiles" })
311309 log .debug (" git status.showUntrackedFiles =" , showUntracked [1 ])
312310 if showUntracked [1 ] == " no" then
313311 unstaged_job :after (parse_lines )
0 commit comments