@@ -210,6 +210,7 @@ function makeHarness(options: HarnessOptions = {}) {
210210 options . fetchWorktreeBaseCommit ??
211211 ( ( ) => Effect . succeed ( { commitSha : "remote-main-sha" , remoteRefName : "origin/main" } ) ) ,
212212 hasCommit : options . hasCommit ?? ( ( ) => Effect . succeed ( false ) ) ,
213+ currentBranch : ( ) => Effect . succeed ( null ) ,
213214 resolveWorktreeBaseRemote : ( ) => Effect . succeed ( { remoteName : "origin" , branchName : "main" } ) ,
214215 remoteExists : options . remoteExists ?? ( ( ) => Effect . succeed ( true ) ) ,
215216 remoteBranchExists : ( ) => Effect . succeed ( true ) ,
@@ -981,6 +982,21 @@ function scheduledTaskInput(id: string, targetProjectId: ProjectId) {
981982 } ;
982983}
983984
985+ it . effect ( "records the checkout's branch on a root launch that names none" , ( ) => {
986+ const harness = makeHarness ( {
987+ git : { currentBranch : ( ) => Effect . succeed ( "fix/checkout-total" ) } ,
988+ } ) ;
989+ return Effect . gen ( function * ( ) {
990+ const launches = yield * ThreadLaunch . ThreadLaunchService ;
991+ const launched = yield * launches . launch (
992+ launchInput ( { command : "command:launch:root-branch" , thread : "thread:launch:root-branch" } ) ,
993+ ) ;
994+ const threads = yield * ThreadManagement . ThreadManagementService ;
995+ const { thread } = yield * threads . getThreadProjection ( launched . threadId ) ;
996+ assert . equal ( thread . branch , "fix/checkout-total" ) ;
997+ } ) . pipe ( Effect . provide ( harness . layer ) ) ;
998+ } ) ;
999+
9841000it . effect ( "launches a worktree request for Scratch at the root, in its own folder" , ( ) => {
9851001 const harness = scratchHarness ( ) ;
9861002 return Effect . gen ( function * ( ) {
0 commit comments