Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/opencode/src/snapshot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ export const layer: Layer.Layer<
})

const patch = Effect.fnUntraced(function* (hash: string) {
if (!(yield* enabled())) return { hash, files: [] }
return yield* locked(
Effect.gen(function* () {
yield* add()
Expand Down Expand Up @@ -349,6 +350,7 @@ export const layer: Layer.Layer<
})

const restore = Effect.fnUntraced(function* (snapshot: string) {
if (!(yield* enabled())) return
return yield* locked(
Effect.gen(function* () {
log.info("restore", { commit: snapshot })
Expand All @@ -375,6 +377,7 @@ export const layer: Layer.Layer<
})

const revert = Effect.fnUntraced(function* (patches: Patch[]) {
if (!(yield* enabled())) return
return yield* locked(
Effect.gen(function* () {
const ops: { hash: string; file: string; rel: string }[] = []
Expand Down Expand Up @@ -490,6 +493,7 @@ export const layer: Layer.Layer<
})

const diff = Effect.fnUntraced(function* (hash: string) {
if (!(yield* enabled())) return ""
return yield* locked(
Effect.gen(function* () {
yield* add()
Expand All @@ -510,6 +514,7 @@ export const layer: Layer.Layer<
})

const diffFull = Effect.fnUntraced(function* (from: string, to: string) {
if (!(yield* enabled())) return []
return yield* locked(
Effect.gen(function* () {
type Row = {
Expand Down
Loading