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) => {...@@ -1452,13 +1452,13 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => {
1452 mode: "worktree",1452 mode: "worktree",
1453 });1453 });
14541454
1455 expect(result.branch).toBe("pr/91-main");1455 expect(result.branch).toBe("t3code/pr-91/main");
1456 expect(result.worktreePath).not.toBeNull();1456 expect(result.worktreePath).not.toBeNull();
1457 expect((yield* runGit(repoDir, ["branch", "--show-current"])).stdout.trim()).toBe("main");1457 expect((yield* runGit(repoDir, ["branch", "--show-current"])).stdout.trim()).toBe("main");
1458 expect((yield* runGit(repoDir, ["rev-parse", "main"])).stdout.trim()).toBe(mainBefore);1458 expect((yield* runGit(repoDir, ["rev-parse", "main"])).stdout.trim()).toBe(mainBefore);
1459 expect(1459 expect(
1460 (yield* runGit(result.worktreePath as string, ["branch", "--show-current"])).stdout.trim(),1460 (yield* runGit(result.worktreePath as string, ["branch", "--show-current"])).stdout.trim(),
1461 ).toBe("pr/91-main");1461 ).toBe("t3code/pr-91/main");
1462 }),1462 }),
1463 );1463 );
14641464
...@@ -1508,7 +1508,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => {...@@ -1508,7 +1508,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => {
1508 mode: "worktree",1508 mode: "worktree",
1509 });1509 });
15101510
1511 expect(result.branch).toBe("pr/92-main");1511 expect(result.branch).toBe("t3code/pr-92/main");
1512 expect((yield* runGit(repoDir, ["rev-parse", "main"])).stdout.trim()).toBe(localMainBefore);1512 expect((yield* runGit(repoDir, ["rev-parse", "main"])).stdout.trim()).toBe(localMainBefore);
1513 expect(1513 expect(
1514 (yield* runGit(result.worktreePath as string, ["rev-parse", "--abbrev-ref", "@{upstream}"]))1514 (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(...@@ -79,7 +79,7 @@ function resolvePullRequestWorktreeLocalBranchName(
7979
80 const sanitizedHeadBranch = sanitizeBranchFragment(pullRequest.headBranch).trim();80 const sanitizedHeadBranch = sanitizeBranchFragment(pullRequest.headBranch).trim();
81 const suffix = sanitizedHeadBranch.length > 0 ? sanitizedHeadBranch : "head";81 const suffix = sanitizedHeadBranch.length > 0 ? sanitizedHeadBranch : "head";
82 return `pr/${pullRequest.number}-${suffix}`;82 return `t3code/pr-${pullRequest.number}/${suffix}`;
83}83}
8484
85function parsePullRequestList(raw: unknown): PullRequestInfo[] {85function parsePullRequestList(raw: unknown): PullRequestInfo[] {