@@ -485,8 +485,10 @@ const runCleanupTest = <A, E>(
485485it . live . each ( [
486486 { policy : "tracked-changes" , kind : "worktree" } ,
487487 { policy : "tracked-changes" , kind : "repository" } ,
488+ { policy : "tracked-changes" , kind : "bare" } ,
488489 { policy : "uncommitted-changes" , kind : "worktree" } ,
489490 { policy : "uncommitted-changes" , kind : "repository" } ,
491+ { policy : "uncommitted-changes" , kind : "bare" } ,
490492] as const ) ( "keeps an ignored nested $policy / $kind" , ( { policy, kind } ) =>
491493 runCleanupTest (
492494 Effect . gen ( function * ( ) {
@@ -496,7 +498,13 @@ it.live.each([
496498 if ( kind === "worktree" ) {
497499 yield * command ( repo , [ "worktree" , "add" , "-b" , "nested" , nested ] ) ;
498500 } else {
499- yield * command ( repo , [ "clone" , "--no-hardlinks" , repo , nested ] ) ;
501+ yield * command ( repo , [
502+ "clone" ,
503+ "--no-hardlinks" ,
504+ ...( kind === "bare" ? [ "--bare" ] : [ ] ) ,
505+ repo ,
506+ nested ,
507+ ] ) ;
500508 }
501509 yield * fs . writeFileString ( `${ nested } /uncommitted.txt` , "irreplaceable work\n" ) ;
502510 expect ( ( yield * command ( worktree , [ "status" , "--porcelain" ] ) ) . stdout ) . toBe ( "" ) ;
@@ -506,7 +514,14 @@ it.live.each([
506514 reason : "Contains a nested Git repository" ,
507515 } ) ;
508516 expect ( yield * fs . readFileString ( `${ nested } /uncommitted.txt` ) ) . toBe ( "irreplaceable work\n" ) ;
509- expect ( ( yield * command ( nested , [ "rev-parse" , "--show-toplevel" ] ) ) . stdout . trim ( ) ) . toBe ( nested ) ;
517+ expect (
518+ ( yield * command ( nested , [
519+ "-c" ,
520+ "safe.bareRepository=all" ,
521+ "rev-parse" ,
522+ "--is-bare-repository" ,
523+ ] ) ) . stdout . trim ( ) ,
524+ ) . toBe ( String ( kind === "bare" ) ) ;
510525 } ) ,
511526 ) ,
512527) ;
0 commit comments