import { type ExecResult } from "./exec.js"; /** Options every git helper takes: cancellation from `extra.signal`, and a timeout. */ export interface GitOpts { signal?: AbortSignal; timeoutMs?: number; } /** * Run one git command without blocking the event loop. * * v10 rule (spec §3.7): nothing on the request path may use execSync — a * synchronous git in a repo with a cold cache stalls every other in-flight * request, and it cannot be cancelled. runCommandStream spawns, so it can be * both awaited and aborted. */ export declare function git(cmd: string, cwd: string, opts?: GitOpts): Promise; export interface RepoStatus { name: string; path: string; branch: string; head: string; dirtyFiles: string[]; } export declare function getRepoStatus(name: string, repoPath: string, opts?: GitOpts): Promise; /** Status of many repos at once, at most `limit` gits in flight. */ export declare function getRepoStatuses(repos: Record, opts?: GitOpts & { limit?: number; }): Promise; /** * Get the pinned commit hash of a submodule. * * `submodule` may be either a canonical name (e.g. "crosspad-core") or a * relative path (e.g. "lib/crosspad-core"). Names are resolved via .gitmodules. */ export declare function getSubmodulePin(repoPath: string, submodule: string, opts?: GitOpts): Promise; export declare function getHead(repoPath: string, opts?: GitOpts): Promise; /** @internal exported for testing — drop the .gitmodules cache. */ export declare function _resetSubmoduleCache(): void; export declare function listSubmodules(repoPath: string, opts?: GitOpts): Promise>; /** Resolve a submodule's path within a parent repo by canonical name. Null if not present. */ export declare function findSubmodulePath(repoPath: string, submoduleName: string, opts?: GitOpts): Promise;