Compare commits

...

1 Commits

Author SHA1 Message Date
rekram1-node d021703b21 fix(opencode): skip nested repositories in snapshots 2026-08-22 22:13:26 +00:00
2 changed files with 20 additions and 1 deletions
+1 -1
View File
@@ -257,7 +257,7 @@ const layer: Layer.Layer<Service, never, FSUtil.Service | AppProcess.Service | C
const tracked = diff.text.split("\0").filter(Boolean)
const untracked = other.text.split("\0").filter(Boolean)
const all = Array.from(new Set([...tracked, ...untracked]))
const all = Array.from(new Set([...tracked, ...untracked])).filter((item) => !item.endsWith("/"))
if (!all.length) return
// Resolve source-repo ignore rules against the exact candidate set.
@@ -174,6 +174,25 @@ it.instance(
{ git: true },
)
it.instance(
"skips untracked nested repositories without commits",
Effect.gen(function* () {
const tmp = yield* bootstrap()
const snapshot = yield* Snapshot.Service
const before = yield* snapshot.track()
expect(before).toBeTruthy()
yield* exec(tmp.path, ["git", "init", "tui"])
yield* write(`${tmp.path}/tui/nested.txt`, "nested")
yield* write(`${tmp.path}/added.txt`, "added")
const files = (yield* snapshot.patch(before!)).files
expect(files).toContain(fwd(tmp.path, "added.txt"))
expect(files.some((file) => file.includes("/tui/"))).toBe(false)
}),
{ git: true },
)
it.instance(
"binary file handling",
withTrackedSnapshot(({ tmp, snapshot, before }) =>