/** `-c` overrides that disable every repo-config execution sink GG's calls can reach. */ export declare const GIT_HARDENING_CONFIG_ARGS: readonly string[]; /** * Inserted right after the subcommand of diff-producing commands: external * diff drivers (`diff.external`, `diff..command`) and `textconv` * filters are repo-configured programs. `-c diff.external=` is NOT used — an * empty value makes `git diff` die with "cannot run". */ export declare const GIT_NO_EXTERNAL_DIFF_ARGS: readonly string[]; /** * Inserted after `status`: inspecting a submodule's work tree spawns a nested * `git status` inside it, which honours the submodule's OWN filter drivers * (its config was never probed). `dirty` still reports moved submodule * commits but never enters the submodule work tree. Skipped when the caller * passes its own `--ignore-submodules`. */ export declare const GIT_STATUS_SUBMODULE_ARGS: readonly string[]; /** * Build `-c` overrides that blank every filter / merge driver named in the * NUL-separated output of `git config -z --name-only --get-regexp`. Returns * null when a driver name contains `=` — `-c` splits at the first `=`, so the * override could not be expressed and the caller must refuse to run. */ export declare function buildDriverOverrides(outputs: readonly string[]): string[] | null; /** * The git executable. On Windows, libuv's PATH search tries the child's cwd * first, so a `git.exe` planted at a repo root would run instead of git — * resolve an absolute path from PATH once instead. */ export declare function resolveGitBinary(): string; export interface BackgroundGitOptions { cwd: string; timeoutMs?: number; maxBuffer?: number; /** Written to stdin, which is then closed. */ input?: string; signal?: AbortSignal; /** Extra environment on top of `process.env` and the hardening env. */ env?: Readonly>; /** * Repo-selecting global options (`--git-dir=…`, `--work-tree=…`) placed * before the subcommand — and before `config` in the driver probe, so it * inspects the same repository. */ globalArgs?: readonly string[]; } export interface BackgroundGitResult { stdout: string; stderr: string; } /** * Rejection of {@link runBackgroundGit}, shaped like a promisified execFile * error: `code` is git's exit status (number) or a spawn errno (string). */ export declare class BackgroundGitError extends Error { readonly code: number | string | null; readonly killed: boolean; readonly stdout: string; readonly stderr: string; constructor(message: string, details: { code: number | string | null; killed: boolean; stdout: string; stderr: string; }); } /** * Full argv for a hardened background git call (minus the binary). Exposed * for tests; callers use {@link runBackgroundGit}. */ export declare function hardenedGitArgs(args: readonly string[], options: BackgroundGitOptions): Promise; /** * Run git for GG's own background purposes with repo-config execution sinks * disabled. Resolves `{stdout, stderr}` on exit 0; rejects with * {@link BackgroundGitError} otherwise. Output is identical to plain git. */ export declare function runBackgroundGit(args: readonly string[], options: BackgroundGitOptions): Promise; export declare function getGitBranch(cwd: string): Promise; /** Count staged, modified, deleted, renamed, and untracked files. */ export declare function getGitDirtyFileCount(cwd: string): Promise; /** * Whether `cwd` is inside a git work tree. Distinct from getGitBranch, which * returns null both for non-repos AND for freshly-init'd repos with no commits * (rev-parse HEAD fails before the first commit). */ export declare function isGitRepo(cwd: string): Promise;