/** * Locating a repo's git metadata, and reading the branch out of it. * * Shared because two callers want it for different reasons: the footer shows the * live branch and watches it for changes, while a session records the branch it * started on into its header. Keeping one implementation means the branch a * session remembers is the same string the footer was showing at the time. */ export type GitPaths = { repoDir: string; commonGitDir: string; headPath: string; }; /** * Find git metadata paths by walking up from cwd. * Handles both regular git repos (.git is a directory) and worktrees (.git is a file). */ export declare function findGitPaths(cwd: string): GitPaths | null; /** Ask git for the current branch. Returns null on detached HEAD or if git is unavailable. */ export declare function resolveBranchWithGitSync(repoDir: string): string | null; /** * Read the branch from an already-located HEAD. Returns "detached" when HEAD is * not on a branch, null when it cannot be read at all. Reftable repos write a * `.invalid` placeholder into HEAD, which is the one case that has to shell out. */ export declare function readBranchFromHead(paths: GitPaths): string | null; /** * The branch `cwd` is on, or undefined when there is no branch worth recording — * outside a repo, or on a detached HEAD, where the answer names no work. * * Cheap enough to call on the session-creation path: a walk up to `.git` and one * file read, with no subprocess outside the reftable case. */ export declare function readGitBranch(cwd: string): string | undefined; //# sourceMappingURL=git-branch.d.ts.map