export interface WorktreeEntry { path: string; branch: string | null; } /** Best-effort, read-only git. Resolves to '' on any failure (non-repo, no git). */ export declare function gitBestEffort(root: string, args: string[]): Promise; /** * Parse `git worktree list --porcelain` into `{ path, branch }` entries. Each * `worktree ` line starts a new entry; a following `branch * refs/heads/` line (before the next `worktree ` line) sets that * entry's branch, stripped of the `refs/heads/` prefix. A `detached` line (or * no branch line at all) leaves `branch: null`. */ export declare function parseWorktreePorcelain(porcelain: string): WorktreeEntry[]; /** * Canonicalize an absolute worktree path for equality comparison. `git worktree * list` emits forward-slash paths (and, on Windows, may differ in drive-letter * case) while a caller's root is Node-built with platform separators — so a raw * string compare makes the main worktree look unequal to itself on Windows, * leaking it in as a phantom "sibling" of itself. Normalizing separators to `/`, * stripping a trailing slash, and case-folding on win32 fixes that. Pure + * platform-parametrized so it is testable off-Windows. */ export declare function normalizeWorktreePath(p: string, platform?: NodeJS.Platform): string; /** True when two worktree paths refer to the same worktree (separator/case-robust). */ export declare function isSameWorktree(a: string, b: string, platform?: NodeJS.Platform): boolean; /** * Canonical key for a worktree path: realpath when the dir exists (resolves * Windows 8.3 short-names, symlinks, and on-disk casing) then separator/case * normalization. Best-effort — falls back to plain normalization if realpath * fails (e.g. a pruned worktree). Used to robustly identify "self" so the main * worktree is never collected as a sibling of itself. */ export declare function worktreeKey(p: string): Promise; /** * List every git worktree sharing `repoRoot`'s `.git`, excluding `repoRoot` * itself (self identified by canonical key — realpath + normalize). Never * throws: any git/fs failure resolves to `[]`. */ export declare function listSiblingWorktrees(repoRoot: string): Promise; //# sourceMappingURL=worktrees.d.ts.map