authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-03-09 17:30:17-07:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-03-09 22:50:45-07:00
log076608021c89afb294f4bdc75d99018936540c95
tree4efcecd0367487570430a101377d55d5b273384f
parentfb4f9aa58ef67d192c7692dcfcb58c00a8fb7705

Namespace PR worktree branch names under t3code

- Change local PR worktree branch format from `pr/<number>-<head>` to `t3code/pr-<number>/<head>` - Update GitManager tests to assert the new branch naming convention

2 files changed, 4 insertions(+), 4 deletions(-)

apps/server/src/git/Layers/GitManager.test.ts+3-3
......@@ -1452,13 +1452,13 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => {
14521452 mode: "worktree",
14531453 });
14541454
1455 expect(result.branch).toBe("pr/91-main");
1455 expect(result.branch).toBe("t3code/pr-91/main");
14561456 expect(result.worktreePath).not.toBeNull();
14571457 expect((yield* runGit(repoDir, ["branch", "--show-current"])).stdout.trim()).toBe("main");
14581458 expect((yield* runGit(repoDir, ["rev-parse", "main"])).stdout.trim()).toBe(mainBefore);
14591459 expect(
14601460 (yield* runGit(result.worktreePath as string, ["branch", "--show-current"])).stdout.trim(),
1461 ).toBe("pr/91-main");
1461 ).toBe("t3code/pr-91/main");
14621462 }),
14631463 );
14641464
......@@ -1508,7 +1508,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => {
15081508 mode: "worktree",
15091509 });
15101510
1511 expect(result.branch).toBe("pr/92-main");
1511 expect(result.branch).toBe("t3code/pr-92/main");
15121512 expect((yield* runGit(repoDir, ["rev-parse", "main"])).stdout.trim()).toBe(localMainBefore);
15131513 expect(
15141514 (yield* runGit(result.worktreePath as string, ["rev-parse", "--abbrev-ref", "@{upstream}"]))
apps/server/src/git/Layers/GitManager.ts+1-1
......@@ -79,7 +79,7 @@ function resolvePullRequestWorktreeLocalBranchName(
7979
8080 const sanitizedHeadBranch = sanitizeBranchFragment(pullRequest.headBranch).trim();
8181 const suffix = sanitizedHeadBranch.length > 0 ? sanitizedHeadBranch : "head";
82 return `pr/${pullRequest.number}-${suffix}`;
82 return `t3code/pr-${pullRequest.number}/${suffix}`;
8383}
8484
8585function parsePullRequestList(raw: unknown): PullRequestInfo[] {