@@ -377,23 +377,24 @@ it.layer(layerTest)("ProjectService", (it) => {
377377 NodeFS . mkdirSync ( source ) ;
378378 git ( source , "init" , "-b" , "develop" ) ;
379379 git ( source , "commit" , "--allow-empty" , "-m" , "init" ) ;
380- const makeContainer = ( name : string , coreBare : boolean ) => {
380+ const makeContainer = ( name : string , coreBare : boolean , checkoutName : string ) => {
381381 const root = NodePath . join ( fixture , name ) ;
382382 git ( fixture , "clone" , "--bare" , source , NodePath . join ( root , ".bare" ) ) ;
383383 NodeFS . writeFileSync ( NodePath . join ( root , ".git" ) , "gitdir: ./.bare\n" ) ;
384- git ( root , "worktree" , "add" , "develop" , "develop" ) ;
385- git ( root , "worktree" , "add" , "feature-x" , "-b" , "feature-x" ) ;
384+ git ( root , "worktree" , "add" , checkoutName , "develop" ) ;
386385 // With core.bare=false git treats the container itself as a checkout of HEAD, so the
387386 // bare metadata and every sibling worktree show up as changes.
388387 git ( root , "config" , "core.bare" , String ( coreBare ) ) ;
389388 return root ;
390389 } ;
391390
392- for ( const [ name , coreBare ] of [
393- [ "bare-true" , true ] ,
394- [ "bare-false" , false ] ,
391+ for ( const [ name , coreBare , checkoutName ] of [
392+ [ "bare-true" , true , "develop" ] ,
393+ [ "bare-false" , false , "develop" ] ,
394+ [ "bare-dotdot-true" , true , "..develop" ] ,
395+ [ "bare-dotdot-false" , false , "..develop" ] ,
395396 ] as const ) {
396- const root = makeContainer ( name , coreBare ) ;
397+ const root = makeContainer ( name , coreBare , checkoutName ) ;
397398 const rejected = yield * service
398399 . create ( {
399400 commandId : CommandId . make ( `command:bare-root:${ name } ` ) ,
@@ -405,7 +406,7 @@ it.layer(layerTest)("ProjectService", (it) => {
405406 assert . match ( rejected . message , / w o r k t r e e / i, `core.bare=${ coreBare } ` ) ;
406407 assert . isTrue ( Option . isNone ( yield * service . getByWorkspaceRoot ( root ) ) ) ;
407408
408- const worktreeRoot = NodePath . join ( root , "develop" ) ;
409+ const worktreeRoot = NodePath . join ( root , checkoutName ) ;
409410 const worktree = yield * service . create ( {
410411 commandId : CommandId . make ( `command:bare-root:${ name } :develop` ) ,
411412 projectId : ProjectId . make ( `project:bare-root:${ name } :develop` ) ,
0 commit comments