/** * Structured details on why a git operation failed. * * Hosts inspect `kind` to render whatever guidance is appropriate for their * surface. The lib never embeds CLI hints or vendor copy in the message. */ export interface GitErrorDetails { /** Classifies the failure for host-specific recovery hints. */ kind: "auth-required" | "other"; /** The HTTPS clone URL that was attempted. */ url?: string; /** When the failure looked like missing auth, an SSH-form URL the host can suggest. */ sshUrl?: string; /** Raw stderr from git, if available. */ stderr?: string; } export declare class GitError extends Error { readonly details?: GitErrorDetails | undefined; constructor(message: string, details?: GitErrorDetails | undefined); } /** * Clone a repo with --depth=1 into the given directory. * If ref is provided, clones that specific ref. * * Commit SHAs can't be passed to `git clone --branch`, so for SHA-like refs * we clone the default branch first, then fetch the specific commit. */ export declare function clone(url: string, dest: string, ref?: string): Promise; /** * Fetch latest and reset to origin's HEAD. For updating unpinned repos. */ export declare function fetchAndReset(repoDir: string): Promise; /** * Fetch a specific ref and checkout. */ export declare function fetchRef(repoDir: string, ref: string): Promise; /** * Get the current HEAD commit SHA (full 40 chars). */ export declare function headCommit(repoDir: string): Promise; /** * Get the committer date of HEAD as a Date. * Uses committer date (not author date) to reflect when the commit landed on the branch, * which aligns with "release age" semantics (survives cherry-picks and merges). */ export declare function headCommitDate(repoDir: string): Promise; /** * Find the newest commit on the current branch whose committer date is at least * `minAgeMinutes` minutes old. Unshallows the repo to search full history. * * Returns the SHA, or `null` if no qualifying commit exists (repo is younger * than the threshold). */ export declare function findCommitOlderThan(repoDir: string, minAgeMinutes: number): Promise; /** * Checkout a local ref (commit, branch, tag). No fetch — the ref must already exist locally. */ export declare function checkout(repoDir: string, ref: string): Promise; /** * Check if a directory is a git repository. */ export declare function isGitRepo(dir: string): boolean; //# sourceMappingURL=git.d.ts.map