Skip to content

Commit 4a00343

Browse files
that-github-userunknownclaude
authored
Remove unused getCurrentBranch() and applyDiff() exports (#40)
Both functions were exported but never imported anywhere in the codebase. applyDiff() had a dynamic import anti-pattern; apply.ts uses its own implementation via execFile. Closes #22 Co-authored-by: unknown <that-github-user@github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d614d50 commit 4a00343

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

src/utils/git.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ export async function getRepoRoot(): Promise<string> {
1111
return stdout.trim();
1212
}
1313

14-
export async function getCurrentBranch(): Promise<string> {
15-
const { stdout } = await exec("git", ["rev-parse", "--abbrev-ref", "HEAD"]);
16-
return stdout.trim();
17-
}
18-
1914
export async function createWorktree(id: number): Promise<string> {
2015
const repoRoot = await getRepoRoot();
2116
const dir = await mkdtemp(join(tmpdir(), `thinktank-agent-${id}-`));
@@ -85,21 +80,6 @@ export async function getDiffStats(
8580
}
8681
}
8782

88-
export async function applyDiff(diff: string, targetDir: string): Promise<void> {
89-
const { execFile: execFileCb } = await import("node:child_process");
90-
const child = execFileCb("git", ["apply", "--3way", "-"], {
91-
cwd: targetDir,
92-
});
93-
child.stdin?.write(diff);
94-
child.stdin?.end();
95-
await new Promise<void>((resolve, reject) => {
96-
child.on("close", (code) => {
97-
if (code === 0) resolve();
98-
else reject(new Error(`git apply failed with code ${code}`));
99-
});
100-
});
101-
}
102-
10383
export async function cleanupBranches(): Promise<void> {
10484
const repoRoot = await getRepoRoot();
10585
const { stdout } = await exec("git", ["branch", "--list", "thinktank/*"], {

0 commit comments

Comments
 (0)