Skip to content

Commit 2080390

Browse files
chore: generate
1 parent 1ac3f09 commit 2080390

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

packages/opencode/src/file/watcher.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,13 @@ export const layer = Layer.effect(
132132
cwd: ctx.worktree,
133133
})
134134
const resolved = result.exitCode === 0 ? path.resolve(ctx.worktree, result.text().trim()) : undefined
135-
const vcsDir = resolved
136-
? yield* Effect.promise(() => realpath(resolved).catch(() => resolved))
137-
: undefined
138-
if (vcsDir && !cfgIgnores.includes(".git") && !cfgIgnores.includes(vcsDir) && (!resolved || !cfgIgnores.includes(resolved))) {
135+
const vcsDir = resolved ? yield* Effect.promise(() => realpath(resolved).catch(() => resolved)) : undefined
136+
if (
137+
vcsDir &&
138+
!cfgIgnores.includes(".git") &&
139+
!cfgIgnores.includes(vcsDir) &&
140+
(!resolved || !cfgIgnores.includes(resolved))
141+
) {
139142
const ignore = (yield* Effect.promise(() => readdir(vcsDir).catch(() => []))).filter(
140143
(entry) => entry !== "HEAD",
141144
)

packages/opencode/test/file/watcher.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,10 @@ describeWatcher("FileWatcher", () => {
285285
),
286286
)
287287

288-
yield* Effect.acquireRelease(
289-
Effect.succeed(actualGit),
290-
(p) => Effect.promise(() => import("fs").then((f) => f.promises.rm(p, { recursive: true, force: true }).catch(() => undefined))),
288+
yield* Effect.acquireRelease(Effect.succeed(actualGit), (p) =>
289+
Effect.promise(() =>
290+
import("fs").then((f) => f.promises.rm(p, { recursive: true, force: true }).catch(() => undefined)),
291+
),
291292
)
292293

293294
const head = path.join(dir, ".git", "HEAD")

0 commit comments

Comments
 (0)