/** * GitCli is the real GitPort: it shells out to git via an injected * ProcessRunner. The ProcessRunner seam keeps this logic unit-testable with a * fake; the live binding (NodeProcessRunner) is used in production. */ import { type GitPort } from "../ports/git.ts"; import type { GitMergePort, MergeResult } from "../ports/git-merge.ts"; import type { ProcessRunner } from "../ports/agent.ts"; export declare class GitCli implements GitPort, GitMergePort { private readonly repoRoot; private readonly runner; constructor(repoRoot: string, runner: ProcessRunner); worktreeAdd(issue: string, baseBranch: string, branch?: string): Promise; commit(worktree: string, message: string): Promise; headSha(worktree: string): Promise; diffStat(worktree: string, baseBranch: string): Promise; /** * The file paths changed by a single commit. Uses `git diff-tree` with * `-r` (recurse) and `--no-commit-id`, which lists a root commit's files * correctly (unlike `diff ^ `, which has no parent on the first * commit). One path per line; blank lines dropped. */ committedFiles(worktree: string, sha: string): Promise; /** * Merge `branch` into `targetBranch` in the PRIMARY working copy (repoRoot, * not a worktree). Detect-and-halt: on conflict, collect the conflicting * files and `git merge --abort` so the tree is left clean — conflicts are * NEVER auto-resolved. Throws only on an unexpected git failure (e.g. the * target branch cannot be checked out), not on an ordinary conflict. */ merge(targetBranch: string, branch: string): Promise; /** * Returns true if every commit on `branch` is already contained in * `targetBranch` (i.e., the branch has been merged). Runs in the PRIMARY * working copy (repoRoot). Throws on git failure (e.g., unknown ref). */ isMerged(branch: string, targetBranch: string): Promise; /** * Remove the worktree at `worktree` via `git worktree remove`, run from the * primary working copy. `force` adds --force so a worktree with a dirty or * modified tree is still removed (the caller's --force, gated by cleanIssue's * merged check). Throws on git failure. */ worktreeRemove(worktree: string, force: boolean): Promise; /** * Delete `branch` via `git branch` from the primary working copy. `force` * selects -D (drop even an unmerged branch); otherwise -d (git's own * merged-safety check). Throws on git failure. */ branchDelete(branch: string, force: boolean): Promise; /** The files with merge conflicts (unmerged, diff-filter=U). */ private conflictingFiles; }