diff --git a/src/utils/git.ts b/src/utils/git.ts index f55cd72..f9308fa 100644 --- a/src/utils/git.ts +++ b/src/utils/git.ts @@ -11,11 +11,6 @@ export async function getRepoRoot(): Promise { return stdout.trim(); } -export async function getCurrentBranch(): Promise { - const { stdout } = await exec("git", ["rev-parse", "--abbrev-ref", "HEAD"]); - return stdout.trim(); -} - export async function createWorktree(id: number): Promise { const repoRoot = await getRepoRoot(); const dir = await mkdtemp(join(tmpdir(), `thinktank-agent-${id}-`)); @@ -85,21 +80,6 @@ export async function getDiffStats( } } -export async function applyDiff(diff: string, targetDir: string): Promise { - const { execFile: execFileCb } = await import("node:child_process"); - const child = execFileCb("git", ["apply", "--3way", "-"], { - cwd: targetDir, - }); - child.stdin?.write(diff); - child.stdin?.end(); - await new Promise((resolve, reject) => { - child.on("close", (code) => { - if (code === 0) resolve(); - else reject(new Error(`git apply failed with code ${code}`)); - }); - }); -} - export async function cleanupBranches(): Promise { const repoRoot = await getRepoRoot(); const { stdout } = await exec("git", ["branch", "--list", "thinktank/*"], {