/** * Changed-file detection for `--changed`, so a CI gate (or a human before a * commit) pays only for the SQL that a branch actually touched. * * The git plumbing — base resolution, merge-base diff, working-tree union, * rename targets, dropping paths that no longer exist — lives in `git-changed`, * which is shared with pgpm's bundle-drift check. This module is the `.sql` * filter over it, and the place where "no base" stays non-fatal: a lint gate * that refuses to run on a shallow clone lints nothing, which is worse than * linting the working tree. */ /** * Resolve the ref to diff against. An explicit `base` wins; otherwise the PR * base branch (`origin/$GITHUB_BASE_REF`) when running in GitHub Actions; * otherwise the repository's default branch. `undefined` means "no base" and * the caller falls back to working-tree changes only. */ export declare function resolveChangedBase(base?: string, cwd?: string): string | undefined; export interface ChangedFilesResult { /** Absolute paths of changed files that still exist on disk. */ files: string[]; /** The base ref used, if any. */ base?: string; /** The merge base actually diffed against, if one was resolvable. */ mergeBase?: string; } /** * Collect the files that differ from `base` (via `git merge-base`) plus any * uncommitted/untracked working-tree changes. */ export declare function changedFiles(options?: { cwd?: string; base?: string; }): ChangedFilesResult; /** {@link changedFiles}, narrowed to `.sql`. */ export declare function changedSqlFiles(options?: { cwd?: string; base?: string; }): ChangedFilesResult;