/** * Branch Manager * * Handles git branch operations for autofix PRs. * Uses cross-spawn with array args per CLAUDE.md guidelines. * * @module autofix/branch-manager */ import type { GitResult, BranchInfo } from "./types.js"; /** * Execute a git command and return the result */ export declare function git(args: string[], options?: { cwd: string; timeout?: number; }): Promise; /** * Check if git is available */ export declare function isGitAvailable(cwd: string): Promise; /** * Check if directory is a git repository */ export declare function isGitRepo(cwd: string): Promise; /** * Get the current branch name */ export declare function getCurrentBranch(cwd: string): Promise; /** * Get the default branch name (main or master) */ export declare function getDefaultBranch(cwd: string): Promise; /** * Check if a branch exists locally */ export declare function branchExists(cwd: string, branchName: string): Promise; /** * Check if a branch exists on remote */ export declare function remoteBranchExists(cwd: string, branchName: string, remote?: string): Promise; /** * Create a new branch from a base */ export declare function createBranch(cwd: string, branchName: string, baseBranch: string): Promise; /** * Switch to an existing branch */ export declare function checkoutBranch(cwd: string, branchName: string): Promise; /** * Delete a local branch */ export declare function deleteBranch(cwd: string, branchName: string, force?: boolean): Promise; /** * Stage specific files */ export declare function stageFiles(cwd: string, files: string[]): Promise; /** * Get list of modified files (staged and unstaged) */ export declare function getModifiedFiles(cwd: string): Promise; /** * Get list of staged files */ export declare function getStagedFiles(cwd: string): Promise; /** * Check if working tree is clean */ export declare function isWorkingTreeClean(cwd: string): Promise; /** * Push branch to remote */ export declare function pushBranch(cwd: string, branchName: string, remote?: string, setUpstream?: boolean): Promise; /** * Stash current changes */ export declare function stash(cwd: string, message?: string): Promise; /** * Pop stashed changes */ export declare function stashPop(cwd: string): Promise; /** * Get branch info including tracking */ export declare function getBranchInfo(cwd: string, branchName?: string): Promise; /** * Reset branch to a specific commit */ export declare function resetToCommit(cwd: string, commitish: string, mode?: "soft" | "mixed" | "hard"): Promise; /** * Get the remote URL for origin */ export declare function getRemoteUrl(cwd: string, remote?: string): Promise; /** * Parse GitHub owner/repo from remote URL */ export declare function parseGitHubRemote(url: string): { owner: string; repo: string; } | undefined; /** * Generate a unique branch name */ export declare function generateBranchName(prefix: string, identifier: string): string; /** * Ensure we're on a clean working tree before operations */ export declare function ensureCleanWorkingTree(cwd: string, stashIfDirty?: boolean): Promise<{ clean: boolean; stashed: boolean; }>; /** * Restore original branch state after operations */ export declare function restoreOriginalState(cwd: string, originalBranch: string, wasStashed: boolean): Promise; //# sourceMappingURL=branch-manager.d.ts.map