/** * Git branch detection utility * * Provides auto-detection of current git branch with fallback handling * for edge cases like detached HEAD and non-git repositories. * * IMPORTANT: Uses spawnSync instead of execSync to avoid WSL2 TTY/GPG hangs. * execSync spawns a shell which can get into weird states on WSL2. */ /** * Get the current git branch name * * @returns Current git branch name, or fallback value for edge cases * * Behavior: * - Returns current branch name in normal git repository * - Returns "detached" when HEAD is detached * - Returns "unknown" when not in a git repository * - Respects LEX_DEFAULT_BRANCH environment variable as override * - Respects LEX_GIT_MODE=off to skip git calls entirely * - Caches result for performance * * @example * ```ts * const branch = getCurrentBranch(); * console.log(`Current branch: ${branch}`); * ``` */ export declare function getCurrentBranch(): string; /** * Clear the branch cache * * Useful for testing or when the branch might have changed * (e.g., after a checkout operation) */ export declare function clearBranchCache(): void;