export type DiffMode = 'uncommitted' | 'staged' | 'branch'; /** * Files changed under `mode`, as paths relative to `anchor` (the directory * holding pipework.config.ts — the same base module paths are relative to). * * Three path coordinate systems meet here, and they only coincide when the * anchor IS the git toplevel: `git diff --name-only` prints toplevel-relative * paths regardless of cwd, `git ls-files --others` prints cwd-relative paths, * and module paths are anchor-relative. Every git command therefore runs from * the toplevel and every returned path is rebased onto the anchor before it is * handed to `filesToModules` — otherwise a config dir below the toplevel * (monorepo layout, e.g. /packages/backend) makes every diff path miss * the module prefix match and `rootChanged` widens every scoped run to all * modules. A change outside the anchor subtree comes back as a `../` path, * which deliberately matches no module and keeps the fail-wide behavior. * * `branch` mode (the `--fast` path) returns `null` — never an empty array — * when the set cannot be computed (no base branch, unrelated history, no git): * the caller must fail open on `null`, widening to everything, never silently * scoping to nothing. Issue #325. * * `uncommitted` / `staged` modes return `[]` on a non-git or empty tree — a * clean tree genuinely has nothing to do, and the caller exits 0 (#266). An * empty array always means "computed cleanly, nothing changed". */ export declare function changedFiles(anchor: string, mode: DiffMode, baseBranches?: readonly string[]): string[] | null; /** * The base branch a `branch`-mode diff would be taken against, for scope * reporting (the population line). `null` when none exists or git is absent. */ export declare function resolveBaseBranch(anchor: string, baseBranches?: readonly string[]): string | null; export declare function filesToModules(files: readonly string[], modulePaths: readonly string[]): { modules: Set; rootChanged: boolean; }; //# sourceMappingURL=changed-files.d.ts.map