Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): worktree launches name their branch while the worktree is created #36943

Closedprakharsharma13(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/36943/headopened View on GitHub

Showing 2 changed files with 61 additions and 1 deletion.

x
0 of 2 viewed, 2 left
37 additions and 0 deletionsapps/server/src/orchestration-v2/ThreadLaunchService.test.tsModified
View file
@@ -2663,6 +2663,43 @@
+it.effect("names a new worktree thread's branch while its worktree is being created", () =>
+ Effect.gen(function* () {
+ const branchNameStarted = yield* Deferred.make<void>();
+ const renamedTo = yield* Deferred.make<string>();
+ const harness = makeHarness({
+ generateBranchName: () =>
+ Deferred.succeed(branchNameStarted, undefined).pipe(
+ Effect.as({ branch: "generated-branch" }),
+ ),
+ createWorktree: (input) =>
+ Deferred.await(branchNameStarted).pipe(
+ Effect.as({
+ worktree: {
+ path: "/repo-worktrees/feature",
+ refName: input.newRefName,
+ headSha: "abc",
+ },
+ } as never),
+ ),
+ renameBranch: (input) =>
+ Deferred.succeed(renamedTo, input.newBranch).pipe(Effect.as({ branch: input.newBranch })),
+ });
+ yield* Effect.gen(function* () {
+ const launches = yield* ThreadLaunch.ThreadLaunchService;
+ yield* launches.launch(
+ launchInput({