@@ -1608,6 +1608,43 @@ it.effect("retries a fetch that lost a ref update to another Git process", () =>
16081608) ;
16091609
16101610it . layer ( layerTest ) ( "GitVcsDriver core integration" , ( it ) => {
1611+ it . effect ( "keeps large change sets available for status and commit preparation" , ( ) =>
1612+ Effect . gen ( function * ( ) {
1613+ const cwd = yield * makeTmpDir ( ) ;
1614+ const fs = yield * FileSystem . FileSystem ;
1615+ const path = yield * Path . Path ;
1616+ const driver = yield * GitVcsDriver . GitVcsDriver ;
1617+ yield * git ( cwd , [ "init" ] ) ;
1618+ yield * git ( cwd , [ "config" , "user.email" , "[email protected] " ] ) ; 1619+ yield * git ( cwd , [ "config" , "user.name" , "Test" ] ) ;
1620+ const files = Array . from (
1621+ { length : 6_000 } ,
1622+ ( _ , index ) => `file-${ String ( index ) . padStart ( 5 , "0" ) } -${ "x" . repeat ( 160 ) } .txt` ,
1623+ ) ;
1624+ yield * Effect . forEach ( files , ( file ) => fs . writeFileString ( path . join ( cwd , file ) , "before\n" ) , {
1625+ concurrency : 16 ,
1626+ discard : true ,
1627+ } ) ;
1628+ yield * git ( cwd , [ "add" , "." ] ) ;
1629+ const unborn = yield * driver . statusDetailsLocal ( cwd ) ;
1630+ assert . lengthOf ( unborn . workingTree . files , files . length ) ;
1631+ assert . equal ( unborn . workingTree . insertions , files . length ) ;
1632+ yield * git ( cwd , [ "commit" , "-qm" , "initial" ] ) ;
1633+ yield * Effect . forEach ( files , ( file ) => fs . writeFileString ( path . join ( cwd , file ) , "after\n" ) , {
1634+ concurrency : 16 ,
1635+ discard : true ,
1636+ } ) ;
1637+ const status = yield * driver . statusDetailsLocal ( cwd ) ;
1638+ assert . isTrue ( status . hasWorkingTreeChanges ) ;
1639+ assert . lengthOf ( status . workingTree . files , files . length ) ;
1640+ assert . equal ( status . workingTree . insertions , files . length ) ;
1641+ assert . equal ( status . workingTree . deletions , files . length ) ;
1642+ const context = yield * driver . prepareCommitContext ( cwd , undefined , { includePatch : false } ) ;
1643+ assert . isNotNull ( context ) ;
1644+ assert . isAbove ( context ! . stagedSummary . length , 1_000_000 ) ;
1645+ assert . lengthOf ( context ! . stagedSummary . split ( "\n" ) , files . length ) ;
1646+ } ) ,
1647+ ) ;
16111648 describe ( "process environment" , ( ) => {
16121649 it . effect ( "preserves the caller locale for general Git subprocesses" , ( ) =>
16131650 Effect . gen ( function * ( ) {
0 commit comments