@@ -120,7 +120,7 @@ it.effect("checkpoint capture does not rerun clean filters for unchanged indexed
120120) ;
121121
122122for ( const nested of [ false , true ] ) {
123- for ( const indexState of [ "sparse" , "flags" , "missing" ] as const ) {
123+ for ( const indexState of [ "sparse" , "flags" , "missing" , "non-cone-missing" ] as const ) {
124124 it . effect (
125125 `sparse checkpoint preserves two captures (nested=${ nested } , index=${ indexState } )` ,
126126 ( ) =>
@@ -137,7 +137,6 @@ for (const nested of [false, true]) {
137137 for ( const name of [
138138 "scope/in/edit" ,
139139 "scope/in/delete" ,
140- "scope/in/assumed" ,
141140 "scope/out/absent" ,
142141 "scope/out/present" ,
143142 "elsewhere/file" ,
@@ -154,22 +153,21 @@ for (const nested of [false, true]) {
154153 "scope/in" ,
155154 "elsewhere" ,
156155 ] ) ;
156+ if ( indexState === "non-cone-missing" )
157+ yield * git ( [ "sparse-checkout" , "set" , "--no-cone" , "/scope/in/" , "/elsewhere/" ] ) ;
157158 yield * write ( "scope/in/edit" , "staged\n" ) ;
158- yield * write ( "scope/in/new-deleted" , "staged then deleted\n" ) ;
159159 yield * write ( "elsewhere/file" , "staged outside\n" ) ;
160160 yield * git ( [ "add" , "." ] ) ;
161161 if ( indexState === "flags" )
162- yield * git ( [ "update-index" , "--assume-unchanged" , "scope/in/assumed " ] ) ;
162+ yield * git ( [ "update-index" , "--assume-unchanged" , "scope/in/delete " ] ) ;
163163 yield * git ( [ "config" , "sparse.expectFilesOutsideOfPatterns" , "true" ] ) ;
164164 yield * write ( "scope/in/edit" , "working\n" ) ;
165- yield * write ( "scope/in/assumed" , "modified assumed\n" ) ;
166165 yield * write ( "scope/out/present" , "modified skipped\n" ) ;
167166 yield * write ( "scope/out/new file" , "new outside cone\n" ) ;
168167 yield * write ( "elsewhere/file" , "working outside\n" ) ;
169168 yield * fs . remove ( path . join ( cwd , "scope/in/delete" ) ) ;
170- yield * fs . remove ( path . join ( cwd , "scope/in/new-deleted" ) ) ;
171169 const indexPath = path . join ( cwd , ".git/index" ) ;
172- if ( indexState === "missing" ) yield * fs . remove ( indexPath ) ;
170+ if ( indexState . endsWith ( "missing" ) ) yield * fs . remove ( indexPath ) ;
173171 const originalIndex = yield * fs
174172 . readFile ( indexPath )
175173 . pipe ( Effect . orElseSucceed ( ( ) => null ) ) ;
@@ -181,14 +179,22 @@ for (const nested of [false, true]) {
181179 yield * fs . remove ( path . join ( cwd , "scope/out/new file" ) ) ;
182180 yield * write ( "scope/out/second" , "second addition\n" ) ;
183181 }
184- yield * driver . checkpoints . captureCheckpoint ( {
182+ const capture = driver . checkpoints . captureCheckpoint ( {
185183 cwd : captureCwd ,
186184 checkpointRef : ref ,
187185 } ) ;
186+ if ( indexState === "non-cone-missing" ) {
187+ assert . strictEqual ( ( yield * capture . pipe ( Effect . flip ) ) . _tag , "VcsProcessExitError" ) ;
188+ assert . isFalse (
189+ yield * driver . checkpoints . hasCheckpointRef ( { cwd : captureCwd , checkpointRef : ref } ) ,
190+ ) ;
191+ assert . isFalse ( yield * fs . exists ( indexPath ) ) ;
192+ break ;
193+ }
194+ yield * capture ;
188195 for ( const [ name , content ] of [
189196 [ "scope/out/absent" , "original\n" ] ,
190197 [ "scope/out/present" , "modified skipped\n" ] ,
191- [ "scope/in/assumed" , "modified assumed\n" ] ,
192198 [ "scope/in/edit" , turn === 1 ? "working\n" : "second\n" ] ,
193199 [ "elsewhere/file" , nested ? "original\n" : "working outside\n" ] ,
194200 [
@@ -200,7 +206,6 @@ for (const nested of [false, true]) {
200206 }
201207 const files = ( yield * git ( [ "ls-tree" , "-rz" , "--name-only" , ref ] ) ) . stdout . split ( "\0" ) ;
202208 assert . notInclude ( files , "scope/in/delete" ) ;
203- assert . notInclude ( files , "scope/in/new-deleted" ) ;
204209 if ( turn === 2 ) assert . notInclude ( files , "scope/out/new file" ) ;
205210 assert . deepEqual (
206211 yield * fs . readFile ( indexPath ) . pipe ( Effect . orElseSucceed ( ( ) => null ) ) ,
0 commit comments