typechecked optargs constructors for GitRunner
This commit is contained in:
@@ -128,8 +128,8 @@ function M.reload_project(toplevel, path, callback)
|
||||
return
|
||||
end
|
||||
|
||||
---@type GitRunnerOpts
|
||||
local runner_opts = {
|
||||
---@type GitRunnerArgs
|
||||
local args = {
|
||||
toplevel = toplevel,
|
||||
path = path,
|
||||
list_untracked = git_utils.should_show_untracked(toplevel),
|
||||
@@ -139,14 +139,14 @@ function M.reload_project(toplevel, path, callback)
|
||||
|
||||
if callback then
|
||||
---@param path_xy GitPathXY
|
||||
runner_opts.callback = function(path_xy)
|
||||
args.callback = function(path_xy)
|
||||
reload_git_project(toplevel, path, project, path_xy)
|
||||
callback()
|
||||
end
|
||||
GitRunner:run(runner_opts)
|
||||
GitRunner:run(args)
|
||||
else
|
||||
-- TODO #1974 use callback once async/await is available
|
||||
reload_git_project(toplevel, path, project, GitRunner:run(runner_opts))
|
||||
reload_git_project(toplevel, path, project, GitRunner:run(args))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user