export type ChangeCode = "." | "M" | "A" | "D" | "R" | "C" | "U" | "T" | "?" | "!"; export type FileStatus = { path: string; index: ChangeCode; worktree: ChangeCode; renamedFrom?: string; }; export type GitStatus = { branch: string; upstream: string; ahead: number; behind: number; entries: FileStatus[]; }; export type GitCommit = { sha: string; author: string; email: string; date: string; subject: string; body: string; }; export type GitLog = { commits: GitCommit[]; }; export type FileDiff = { path: string; status: ChangeCode; additions: number | null; deletions: number | null; }; export type GitDiff = { files: FileDiff[]; patch: string; }; export type GitBranch = { name: string; current: boolean; upstream: string; sha: string; }; export type BlameLine = { sha: string; author: string; line: number; content: string; }; export type GitRemote = { name: string; url: string; direction: "fetch" | "push"; }; export type GitStash = { ref: string; description: string; }; export declare const FIELD_SEP = "\u001F"; export declare const RECORD_SEP = "\u001E"; /** * Guard a user-supplied positional (ref, path, branch) before it becomes an * argv element. A value beginning with "-" would be parsed by git as an option * (e.g. `--output=`), so reject it. Callers still place these after * `--end-of-options` / `--` in the argv; this is the second, belt-and-braces * layer. NOTE: this also rejects legitimate filenames that start with "-" * (e.g. "-foo.txt"); the tool `@param`s document that limitation. */ export declare function hardenPositional(value: string, label: string): string; /** * Reject an operation on a protected branch (e.g. main/master). Empty list = * no restriction. Bound via `.partial(protectedBranches: [...])`. Pure string * comparison, so it stays here rather than in the async git.ts layer. */ export declare function assertBranchAllowed(branch: string, protectedBranches: string[]): void; /** Config flags prepended to every git invocation (before the subcommand). */ export declare const GIT_HARDENING_FLAGS: string[]; /** Shallow copy of `base` with git command-injection vars removed. */ export declare function scrubEnv(base: NodeJS.ProcessEnv): NodeJS.ProcessEnv; export declare function statusArgs(): string[]; export declare function logArgs(opts: { count: number; oneline: boolean; path: string; ref: string; author: string; }): string[]; export declare function diffArgs(opts: { ref: string; ref2: string; staged: boolean; path: string; }): string[]; export declare function showArgs(opts: { ref: string; }): string[]; export declare function branchListArgs(): string[]; export declare function remoteListArgs(): string[]; export declare function blameArgs(opts: { path: string; ref: string; }): string[]; export declare function stashListArgs(): string[]; export declare function addArgs(opts: { paths: string[]; all: boolean; }): string[]; export declare function commitArgs(opts: { message: string; }): string[]; export declare function checkoutArgs(opts: { target: string; force: boolean; }): string[]; export declare function switchArgs(opts: { branch: string; create: boolean; }): string[]; export declare function branchCreateArgs(opts: { branch: string; }): string[]; export declare function branchDeleteArgs(opts: { branch: string; force: boolean; protectedBranches: string[]; }): string[]; export declare function stashPushArgs(opts: { message: string; }): string[]; export declare function stashPopArgs(): string[]; export declare function restoreArgs(opts: { paths: string[]; staged: boolean; }): string[];