@@ -4319,13 +4319,13 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => {
43194319 } ) ,
43204320 ) ;
43214321
4322- it . effect ( " flattens a generated name when a branch at its parent path blocks it", ( ) =>
4322+ it . effect . each ( [ "t3" , "T3" ] ) ( " flattens a generated name when parent %s blocks it", ( parent ) =>
43234323 Effect . gen ( function * ( ) {
43244324 const cwd = yield * makeTmpDir ( ) ;
43254325 yield * initRepoWithCommit ( cwd ) ;
43264326 const driver = yield * GitVcsDriver . GitVcsDriver ;
43274327 // A local `t3` branch is why launches start on the flat `t3-<hex>` temporary branch.
4328- yield * git ( cwd , [ "branch" , "t3" ] ) ;
4328+ yield * git ( cwd , [ "branch" , parent ] ) ;
43294329 yield * git ( cwd , [ "checkout" , "-b" , "t3-abcd1234" ] ) ;
43304330 yield * git ( cwd , [ "branch" , "t3-fix-login" ] ) ;
43314331
@@ -4340,24 +4340,26 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => {
43404340 } ) ,
43414341 ) ;
43424342
4343- it . effect ( "skips a flattened name that a nested branch blocks" , ( ) =>
4344- Effect . gen ( function * ( ) {
4345- const cwd = yield * makeTmpDir ( ) ;
4346- yield * initRepoWithCommit ( cwd ) ;
4347- const driver = yield * GitVcsDriver . GitVcsDriver ;
4348- yield * git ( cwd , [ "branch" , "t3" ] ) ;
4349- yield * git ( cwd , [ "checkout" , "-b" , "t3-abcd1234" ] ) ;
4350- yield * git ( cwd , [ "branch" , "t3-fix-login/child" ] ) ;
4343+ it . effect . each ( [ "t3-fix-login/child" , "T3-Fix-Login/child" , "T3-FIX-LOGIN" ] ) (
4344+ "skips a flattened name blocked by %s" ,
4345+ ( occupied ) =>
4346+ Effect . gen ( function * ( ) {
4347+ const cwd = yield * makeTmpDir ( ) ;
4348+ yield * initRepoWithCommit ( cwd ) ;
4349+ const driver = yield * GitVcsDriver . GitVcsDriver ;
4350+ yield * git ( cwd , [ "branch" , "t3" ] ) ;
4351+ yield * git ( cwd , [ "checkout" , "-b" , "t3-abcd1234" ] ) ;
4352+ yield * git ( cwd , [ "branch" , occupied ] ) ;
43514353
4352- const renamed = yield * driver . renameBranch ( {
4353- cwd,
4354- oldBranch : "t3-abcd1234" ,
4355- newBranch : "t3/fix-login" ,
4356- } ) ;
4354+ const renamed = yield * driver . renameBranch ( {
4355+ cwd,
4356+ oldBranch : "t3-abcd1234" ,
4357+ newBranch : "t3/fix-login" ,
4358+ } ) ;
43574359
4358- assert . equal ( renamed . branch , "t3-fix-login-1" ) ;
4359- assert . equal ( yield * git ( cwd , [ "branch" , "--show-current" ] ) , "t3-fix-login-1" ) ;
4360- } ) ,
4360+ assert . equal ( renamed . branch , "t3-fix-login-1" ) ;
4361+ assert . equal ( yield * git ( cwd , [ "branch" , "--show-current" ] ) , "t3-fix-login-1" ) ;
4362+ } ) ,
43614363 ) ;
43624364
43634365 it . effect ( "refuses exhausted automatic suffixes without changing existing branches" , ( ) =>
@@ -4377,6 +4379,8 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => {
43774379 . renameBranch ( { cwd, oldBranch : initialBranch , newBranch : "topic" } )
43784380 . pipe ( Effect . result ) ;
43794381 assert . isTrue ( Result . isFailure ( result ) ) ;
4382+ if ( Result . isFailure ( result ) )
4383+ assert . include ( result . failure . detail , "Could not find an available branch name" ) ;
43804384 assert . equal ( yield * git ( cwd , [ "branch" , "--show-current" ] ) , initialBranch ) ;
43814385 assert . equal ( ( yield * driver . listLocalBranchNames ( cwd ) ) . length , 102 ) ;
43824386 } ) ,
@@ -4388,7 +4392,12 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => {
43884392 Effect . gen ( function * ( ) {
43894393 const cwd = yield * makeTmpDir ( ) ;
43904394 const { initialBranch } = yield * initRepoWithCommit ( cwd ) ;
4391- const expected = yield * git ( cwd , [ "rev-parse" , "HEAD" ] ) ;
4395+ const expected = yield * git ( cwd , [
4396+ "commit-tree" ,
4397+ "HEAD^{tree}" ,
4398+ "-m" ,
4399+ "concurrent winner" ,
4400+ ] ) ;
43924401 const original = yield * GitVcsDriver . GitVcsDriver ;
43934402 const delegate = yield * ChildProcessSpawner . ChildProcessSpawner ;
43944403 let claimed = false ;
@@ -5037,6 +5046,10 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => {
50375046 pathService . dirname ( created . worktree . path ) ,
50385047 pathService . join ( worktreesDirectory , pathService . basename ( cwd ) ) ,
50395048 ) ;
5049+ assert . match (
5050+ pathService . basename ( created . worktree . path ) ,
5051+ / ^ f e a t u r e - c u s t o m - d i r - [ 0 - 9 a - f ] { 16 } $ / ,
5052+ ) ;
50405053 assert . equal ( yield * fileSystem . exists ( created . worktree . path ) , true ) ;
50415054
50425055 const error = yield * driver
0 commit comments