Documentation
¶
Overview ¶
Package files provides filesystem enumeration helpers for the file explorer overlay. It sits alongside session/git rather than inside it because the callers may operate on non-git roots (workspace terminals pointed at bare directories), and because these helpers are stateless path-only operations — session/git is organized around stateful GitWorktree lifecycles.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ListResult ¶
ListResult describes the enumeration output.
Paths are relative to Root, alphabetically sorted. FromGit distinguishes the two code paths so callers (and tests) can assert which route fired without inspecting logs.
func List ¶
func List(root string) (ListResult, error)
List enumerates files under root. When root is a git repository it prefers `git ls-files --cached --others --exclude-standard -z`, which respects .gitignore while still surfacing newly-created untracked files — the workflow the file explorer targets. On a non-git root or when git exits with an error, it falls back to filepath.WalkDir, pruning .git directories and skipping symlinks.
An empty root is rejected because the walk fallback would happily enumerate the current working directory, which is almost never what the caller wants.