GeezerVison is showing github.com — fix(core): ignore unavailable project copy roots (#32234) · comio/opencode@409ba22
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: packages/core/src/project/copy.ts +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -245,6 +245,7 @@ export const layer = Layer.effect( |
245 | 245 | (sourceDirectory) => |
246 | 246 | Effect.forEach(strategies(), (strategy) => |
247 | 247 | strategy.list(sourceDirectory).pipe( |
| 248 | + Effect.catchTag("ProjectCopy.DirectoryUnavailableError", () => Effect.succeed([])), |
248 | 249 | Effect.map((items) => |
249 | 250 | items.map((item) => ({ |
250 | 251 | directory: item.directory, |
|
Collapse file
Copy file name to clipboardExpand all lines: packages/core/test/project-copy.test.ts +12Lines changed: 12 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -365,6 +365,18 @@ describe("ProjectCopy", () => { |
365 | 365 | }), |
366 | 366 | ) |
367 | 367 |
|
| 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 | + |
368 | 380 | it.live("refresh with no roots is a no-op", () => |
369 | 381 | Effect.gen(function* () { |
370 | 382 | const copy = yield* ProjectCopy.Service |
|