refactor: use job instead of args

This commit is contained in:
sxyazi
2024-11-21 12:58:04 +08:00
parent ab7068ef75
commit 139c36e4a7
3 changed files with 14 additions and 14 deletions

View File

@@ -154,11 +154,11 @@ local function setup(st, opts)
end, opts.order)
end
local function fetch(self, args)
local function fetch(self, job)
-- TODO: remove this once Yazi 0.4 is released
args = args or self
job = job or self
local cwd = args.files[1].url:parent()
local cwd = job.files[1].url:parent()
local repo = root(cwd)
if not repo then
remove(tostring(cwd))
@@ -166,7 +166,7 @@ local function fetch(self, args)
end
local paths = {}
for _, f in ipairs(args.files) do
for _, f in ipairs(job.files) do
paths[#paths + 1] = tostring(f.url)
end
@@ -192,7 +192,7 @@ local function fetch(self, args)
end
end
if args.files[1].cha.is_dir then
if job.files[1].cha.is_dir then
ya.dict_merge(changed, bubble_up(changed))
ya.dict_merge(changed, propagate_down(ignored, cwd, Url(repo)))
else