@@ -7,10 +7,12 @@ import {
77import * as Deferred from "effect/Deferred" ;
88import * as Stream from "effect/Stream" ;
99import * as Effect from "effect/Effect" ;
10+ import * as FileSystem from "effect/FileSystem" ;
1011import * as Layer from "effect/Layer" ;
1112
1213import * as GitWorkflowService from "../git/GitWorkflowService.ts" ;
1314import * as VcsStatusBroadcaster from "../vcs/VcsStatusBroadcaster.ts" ;
15+ import * as ProjectionStore from "./ProjectionStore.ts" ;
1416import * as Orchestrator from "./Orchestrator.ts" ;
1517import * as ThreadManagement from "./ThreadManagementService.ts" ;
1618import * as WorktreeBranchSync from "./WorktreeBranchSync.ts" ;
@@ -27,7 +29,7 @@ it.effect.each([false, true])(
2729 snapshotSequence : 0 ,
2830 threads : [
2931 thread ( "generated" , "t3/unify-converter-branches" , "/worktree" ) ,
30- thread ( "shared" , "t3/bfc349ae" , "/worktree" ) ,
32+ thread ( "shared" , "t3/bfc349ae" , "/link/ worktree" ) ,
3133 thread ( "current" , "union" , "/worktree" ) ,
3234 thread ( "root" , "main" , null ) ,
3335 thread ( "other" , "feature" , "/other" ) ,
@@ -50,25 +52,31 @@ it.effect.each([false, true])(
5052 } ) ,
5153 [
5254 [ "generated" , "union" , "t3/unify-converter-branches" , "/worktree" ] ,
53- [ "shared" , "union" , "t3/bfc349ae" , "/worktree" ] ,
55+ [ "shared" , "union" , "t3/bfc349ae" , "/link/ worktree" ] ,
5456 [ "archived" , "union" , "t3/bfc349ae" , "/worktree" ] ,
5557 ] ,
5658 ) ;
5759 } ) . pipe (
5860 Effect . provide (
5961 Layer . mergeAll (
62+ FileSystem . layerNoop ( {
63+ realPath : ( path ) => Effect . succeed ( path === "/link/worktree" ? "/worktree" : path ) ,
64+ } ) ,
65+ Layer . mock ( ProjectionStore . ProjectionStoreV2 ) ( {
66+ getThreadWorktreePaths : ( ) =>
67+ Effect . succeed (
68+ [ ...snapshot . threads , ...snapshot . archivedThreads ] . flatMap ( ( thread ) =>
69+ thread . worktreePath === null
70+ ? [ ]
71+ : [ { threadId : thread . id , worktreePath : thread . worktreePath } ] ,
72+ ) ,
73+ ) ,
74+ } ) ,
6075 Layer . mock ( VcsStatusBroadcaster . VcsStatusBroadcaster ) ( {
61- streamLocalChanges : Stream . fromIterable ( [ null , "t3/bfc349ae" , "union" ] ) . pipe (
76+ streamBranchChanges : Stream . fromIterable ( [ null , "t3/bfc349ae" , "union" ] ) . pipe (
6277 Stream . map ( ( refName ) => ( {
6378 cwd : "/worktree" ,
64- local : {
65- isRepo : true ,
66- refName,
67- isDefaultRef : false ,
68- hasPrimaryRemote : false ,
69- hasWorkingTreeChanges : false ,
70- workingTree : { files : [ ] , insertions : 0 , deletions : 0 } ,
71- } ,
79+ refName,
7280 } ) ) ,
7381 Stream . ensuring ( Deferred . succeed ( reconciled , undefined ) ) ,
7482 ) ,
0 commit comments