File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -245,6 +245,7 @@ export const layer = Layer.effect(
245245 ( sourceDirectory ) =>
246246 Effect . forEach ( strategies ( ) , ( strategy ) =>
247247 strategy . list ( sourceDirectory ) . pipe (
248+ Effect . catchTag ( "ProjectCopy.DirectoryUnavailableError" , ( ) => Effect . succeed ( [ ] ) ) ,
248249 Effect . map ( ( items ) =>
249250 items . map ( ( item ) => ( {
250251 directory : item . directory ,
Original file line number Diff line number Diff line change @@ -365,6 +365,18 @@ describe("ProjectCopy", () => {
365365 } ) ,
366366 )
367367
368+ it . live ( "refresh ignores existing directories that are no longer git checkouts" , ( ) =>
369+ Effect . gen ( function * ( ) {
370+ const input = yield * setup ( )
371+ yield * Effect . promise ( ( ) => fs . rm ( path . join ( input . sourceDirectory , ".git" ) , { recursive : true } ) )
372+ const copy = yield * ProjectCopy . Service
373+
374+ yield * copy . refresh ( { projectID : input . projectID } )
375+
376+ expect ( yield * stored ( input . projectID ) ) . toEqual ( [ { directory : input . sourceDirectory , strategy : null } ] )
377+ } ) ,
378+ )
379+
368380 it . live ( "refresh with no roots is a no-op" , ( ) =>
369381 Effect . gen ( function * ( ) {
370382 const copy = yield * ProjectCopy . Service
You can’t perform that action at this time.
0 commit comments