/** * Local git probes for the deploy safety checks (clean tree, HEAD == remote, * ref resolution). Shell out to `git` rather than depend on simple-git — * matches what wrangler/vercel/fly do, no runtime dep. */ export declare class GitError extends Error { command: string; exitCode: number; stderr: string; constructor(command: string, exitCode: number, stderr: string); } export declare function currentBranch(cwd?: string): Promise; /** * Returns the fetch URL for the given remote, with credentials and .git suffix * stripped so it's safe to store server-side or pass to importProject. */ export declare function getRemoteUrl(remote?: string, cwd?: string): Promise; export declare function headSha(cwd?: string): Promise; export declare function localBranchHeadSha(branch: string, cwd?: string): Promise; export declare function isWorkingTreeClean(cwd?: string): Promise; export declare function upstreamBranch(cwd?: string): Promise; export declare function upstreamForBranch(branch: string, cwd?: string): Promise; export declare function remoteHeadSha(upstream: string, cwd?: string): Promise; /** * Resolve a ref (branch / tag / sha) to a sha. Returns null if git can't * resolve it, so callers can fall back to "use HEAD". */ export declare function resolveRef(ref: string, cwd?: string): Promise; /** * Spec §7 ancestry check: is `candidate` reachable from `mainRef` (i.e. has * mainRef been merged forward to include candidate)? * * `git merge-base --is-ancestor` exits 0 if candidate is an ancestor of * mainRef, 1 if not, anything else on hard error. */ export declare function isAncestor(candidate: string, mainRef: string, cwd?: string): Promise; export interface DeploySafetyResult { branch: string; headSha: string; upstream: string; remoteSha: string; } /** * Spec §10 deploy ref safety checks. Throws on any failure with a CLI-friendly * message; returns the resolved commit context on pass. */ export declare function assertDeploySafety(cwd?: string): Promise; /** * Validate a named branch for deploy without depending on the currently * checked-out branch. This is the Fabric CLI deploy contract: deploy the * target branch, not "whatever branch I happen to be on". */ export declare function assertNamedBranchDeploySafety(branch: string, cwd?: string): Promise;