/** * MRSF Git Integration — Git-aware operations for re-anchoring and discovery. * * Uses child_process.execFile (no shell) for safety. * All functions degrade gracefully when Git is unavailable. */ import type { DiffHunk } from "./types.js"; /** * Check whether `git` is available on PATH. */ export declare function isGitAvailable(): Promise; /** Reset cached availability (for testing). */ export declare function resetGitCache(): void; /** * Find the Git repository root from a given directory. * Returns null if not in a Git repo. */ export declare function findRepoRoot(cwd?: string): Promise; /** * Read the repository-local Git author name. * * Only `.git/config` is considered; global Git identity is intentionally * ignored so callers can distinguish repository identity from user defaults. */ export declare function getGitUserName(repoRoot: string): Promise; /** * Get the full HEAD commit SHA. */ export declare function getCurrentCommit(repoRoot: string): Promise; /** Resolve a revision name or abbreviated SHA to its canonical commit SHA. */ export declare function resolveCommit(revision: string, repoRoot: string): Promise; /** * Check if a commit hash is the same as HEAD. */ export declare function isStale(commentCommit: string, repoRoot: string): Promise; /** * Parse unified diff output into structured hunks. */ export declare function parseDiffHunks(diffOutput: string): DiffHunk[]; /** * Get diff hunks between two commits for a specific file. */ export declare function getDiff(fromCommit: string, toCommit: string, filePath: string, repoRoot: string): Promise; /** * Calculate the net line shift for a given original line number * based on diff hunks. * * Returns the number of lines to add to the original line number, * or null if the line itself was modified/deleted. */ export declare function getLineShift(hunks: DiffHunk[], originalLine: number): { shift: number; modified: boolean; }; /** * Get the contents of a file at a specific commit. * Returns null if unavailable. */ export declare function getFileAtCommit(commit: string, filePath: string, repoRoot: string): Promise; /** * Get list of staged files matching a pattern. */ export declare function getStagedFiles(repoRoot: string, pattern?: string): Promise; /** * Get staged diff hunks for a specific file. */ export declare function getStagedDiff(filePath: string, repoRoot: string): Promise; /** * Detect file renames between two commits. * Returns a map of old path → new path. */ export declare function detectRenames(fromCommit: string, toCommit: string, repoRoot: string): Promise>; /** * Stage a file for commit. */ export declare function stageFile(filePath: string, repoRoot: string): Promise; //# sourceMappingURL=git.d.ts.map