mirror of
https://github.com/TimUntersberger/neogit
synced 2024-09-16 14:24:09 +02:00
lint
This commit is contained in:
parent
4a4657ffaa
commit
c73993c1c6
1 changed files with 14 additions and 7 deletions
|
@ -54,15 +54,22 @@ function M.list(opts)
|
|||
|
||||
if path then
|
||||
local main = Path.new(path, ".git"):is_dir()
|
||||
if not opts.include_main and main then
|
||||
-- no-op
|
||||
else
|
||||
table.insert(worktrees, {
|
||||
head = head, type = type, ref = ref, main = main, path = path
|
||||
})
|
||||
end
|
||||
table.insert(worktrees, {
|
||||
head = head,
|
||||
type = type,
|
||||
ref = ref,
|
||||
main = main,
|
||||
path = path,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
if not opts.include_main then
|
||||
worktrees = util.filter(worktrees, function(worktree)
|
||||
if not worktree.main then
|
||||
return worktree
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
return worktrees
|
||||
|
|
Loading…
Reference in a new issue