/** * Check if a directory is a git repository * @param dirPath Directory path * @returns "Yes" if it's a git repository, "No" otherwise */ export declare function isGitRepository(dirPath: string): string; /** * Get the root directory of the git repository * @param cwd Working directory * @returns Repository root path */ export declare function getGitRepoRoot(cwd: string): string; /** * Get the common directory of the git repository (handles worktrees) * @param cwd Working directory * @returns Repository common directory path */ export declare function getGitCommonDir(cwd: string): string; /** * Get the main repository root directory (the first worktree in the list) * @param cwd Working directory * @returns Main repository root path */ export declare function getGitMainRepoRoot(cwd: string): string; /** * Resolve the git directory for a repository by walking up from `cwd`. * Handles both normal repos (.git is a directory) and worktrees * (.git is a file pointing to the main repo's worktree git dir). * For worktrees, reads the `commondir` file to find the common git dir. * @param cwd Working directory to start searching from * @returns Absolute path to the git directory, or null if not found */ export declare function resolveGitDir(cwd: string): string | null; /** * Get the default remote branch (e.g., origin/main) using filesystem reads. * No subprocess calls — matches Claude Code's approach. * * Priority: * 1. Read refs/remotes/origin/HEAD symref → extract branch name (verify it exists) * 2. Check if refs/remotes/origin/main ref exists * 3. Check if refs/remotes/origin/master ref exists * 4. Hardcoded "main" fallback * * @param cwd Working directory * @returns Default remote branch name */ export declare function getDefaultRemoteBranch(cwd: string): string; /** * Ensure that Wave runtime files are excluded from git status by writing * patterns to `.git/info/exclude` (per-repo, not global). * * Idempotent: if the marker `# wave-runtime` is already present in the * exclude file, it skips writing. A module-level Set provides additional * per-process dedup to avoid redundant file reads. * * @param cwd Working directory to start searching from */ export declare function ensureWaveRuntimeFilesExcluded(cwd: string): void; /** * Check if there are uncommitted changes in the working directory * @param cwd Working directory * @returns True if there are uncommitted changes */ export declare function hasUncommittedChanges(cwd: string): boolean; /** * Check if there are new commits in the current branch that are not in the base branch * @param cwd Working directory * @param baseBranch Base branch name (e.g., origin/main) * @returns True if there are new commits */ export declare function hasNewCommits(cwd: string, baseBranch?: string): boolean;