export declare class GitCommandError extends Error { readonly cwd: string; readonly args: readonly string[]; readonly stderr: string; constructor(cwd: string, args: readonly string[], stderr: string); } export declare function runGitCommand(cwd: string, args: readonly string[]): string; /** 一次读取逐提交路径;NUL 分隔保留空格、换行及类似 hash 的文件名。 */ export declare function readGitCommitPaths(cwd: string, commits: readonly string[]): Map; export declare function runGitCommandAsync(cwd: string, args: readonly string[]): Promise; /** 合并前只导入源检出中已有的 gitlink 提交,不切换子仓 HEAD 或改写工作区。 */ export declare function fetchGitlinkCommitsForMerge(targetRoot: string, sourceRoot: string, sourceCommit: string): void; /** 源文件比较保留前后空白和换行,不能使用会 trim 的命令输出。 */ export declare function readGitBlob(cwd: string, objectId: string): string; /** 按内容对象批量读取原文;每批缓冲随实际对象大小分配,默认完整读取。 */ export declare function readGitBlobs(cwd: string, objectIds: readonly string[], maxBlobBytes?: number): Map; export declare function gitWorktreeIsClean(cwd: string): boolean; export declare function assertValidGitBranchName(cwd: string, branch: string): void; export declare function readGitStatusPorcelain(cwd: string, pathspecs?: readonly string[]): string; export declare function readGitStatusPorcelainAsync(cwd: string, pathspecs?: readonly string[]): Promise; /** 一次读取分支、HEAD 和工作区状态,仍保留既有指纹使用的 v1 原文。 */ export declare function readGitStatusObservationAsync(cwd: string, pathspecs?: readonly string[], options?: { allowUnborn?: boolean; includeIgnored?: boolean; }): Promise<{ head: string; branch: string; status: string; }>; export declare function parseGitStatusObservation(raw: string, options?: { allowUnborn?: boolean; }): { head: string; branch: string; status: string; }; export declare function gitStatusPaths(cwd: string): string[]; /** Parse the same untrimmed NUL-delimited observation used by the caller. */ export declare function parseGitStatusPaths(raw: string): string[]; /** 从同一次完整 status 观察取得未跟踪路径,避免再执行 ls-files。 */ export declare function parseGitStatusUntrackedPaths(raw: string): string[]; export declare function gitBranchRemote(cwd: string, branch: string): string; //# sourceMappingURL=git.d.ts.map