@@ -485,17 +485,19 @@ const runCleanupTest = <A, E>(
485485it . live . each ( [
486486 { policy : "tracked-changes" , kind : "worktree" } ,
487487 { policy : "tracked-changes" , kind : "repository" } ,
488+ { policy : "tracked-changes" , kind : "uppercase" } ,
488489 { policy : "tracked-changes" , kind : "bare" } ,
489490 { policy : "uncommitted-changes" , kind : "worktree" } ,
490491 { policy : "uncommitted-changes" , kind : "repository" } ,
492+ { policy : "uncommitted-changes" , kind : "uppercase" } ,
491493 { policy : "uncommitted-changes" , kind : "bare" } ,
492494] as const ) ( "keeps an ignored nested $policy / $kind" , ( { policy, kind } ) =>
493495 runCleanupTest (
494496 Effect . gen ( function * ( ) {
495497 const { service, fs, repo, worktree, command, setPolicy } = yield * cleanupFixture ( ) ;
496498 setPolicy ( policy ) ;
497499 const nested = `${ worktree } /dist/nested` ;
498- if ( kind === "worktree" ) {
500+ if ( kind === "worktree" || kind === "uppercase" ) {
499501 yield * command ( repo , [ "worktree" , "add" , "-b" , "nested" , nested ] ) ;
500502 } else {
501503 yield * command ( repo , [
@@ -506,6 +508,7 @@ it.live.each([
506508 nested ,
507509 ] ) ;
508510 }
511+ if ( kind === "uppercase" ) yield * fs . rename ( `${ nested } /.git` , `${ nested } /.GIT` ) ;
509512 yield * fs . writeFileString ( `${ nested } /uncommitted.txt` , "irreplaceable work\n" ) ;
510513 expect ( ( yield * command ( worktree , [ "status" , "--porcelain" ] ) ) . stdout ) . toBe ( "" ) ;
511514 const report = yield * service . runNow ;
@@ -516,6 +519,12 @@ it.live.each([
516519 expect ( yield * fs . readFileString ( `${ nested } /uncommitted.txt` ) ) . toBe ( "irreplaceable work\n" ) ;
517520 expect (
518521 ( yield * command ( nested , [
522+ ...( kind === "uppercase"
523+ ? [
524+ `--git-dir=${ ( yield * fs . readFileString ( `${ nested } /.GIT` ) ) . trim ( ) . slice ( 8 ) } ` ,
525+ "--work-tree=." ,
526+ ]
527+ : [ ] ) ,
519528 "-c" ,
520529 "safe.bareRepository=all" ,
521530 "rev-parse" ,
@@ -609,6 +618,33 @@ it.live("removes clean submodules recursively, including deinitialized repositor
609618 yield * command ( repo , [ "clone" , "--no-hardlinks" , repo , legacy ] ) ;
610619 yield * command ( worktree , [ "submodule" , "add" , repo , "legacy" ] ) ;
611620 expect ( ( yield * fs . stat ( `${ legacy } /.git` ) ) . type ) . toBe ( "Directory" ) ;
621+ yield * command ( legacy , [
622+ "-c" ,
623+ "protocol.file.allow=always" ,
624+ "submodule" ,
625+ "add" ,
626+ repo ,
627+ "child" ,
628+ ] ) ;
629+ yield * command ( legacy , [
630+ "-c" ,
631+ "protocol.file.allow=always" ,
632+ "submodule" ,
633+ "add" ,
634+ repo ,
635+ "stored" ,
636+ ] ) ;
637+ yield * command ( legacy , [
638+ "-c" ,
639+ "user.name=Cleanup test" ,
640+ "-c" ,
641+ 642+ "commit" ,
643+ "-am" ,
644+ "record legacy children" ,
645+ ] ) ;
646+ yield * command ( legacy , [ "push" , "origin" , "HEAD:legacy" ] ) ;
647+ yield * command ( legacy , [ "submodule" , "deinit" , "stored" ] ) ;
612648 yield * recordSubmodules ( ) ;
613649 yield * command ( submodule , [ "submodule" , "deinit" , "stored" ] ) ;
614650 const admin = ( yield * command ( worktree , [ "rev-parse" , "--absolute-git-dir" ] ) ) . stdout . trim ( ) ;
0 commit comments