mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-30 06:04:20 +01:00
ci: fixes
This commit is contained in:
@@ -138,6 +138,7 @@ export namespace Config {
|
||||
}
|
||||
|
||||
async function installDependencies(dir: string) {
|
||||
if (Installation.isDev()) return
|
||||
await Bun.write(path.join(dir, "package.json"), "{}")
|
||||
await Bun.write(path.join(dir, ".gitignore"), ["node_modules", "package.json", "bun.lock", ".gitignore"].join("\n"))
|
||||
await BunProc.run(
|
||||
|
||||
@@ -124,6 +124,7 @@ export namespace Snapshot {
|
||||
|
||||
export async function diff(hash: string) {
|
||||
const git = gitdir()
|
||||
await $`git --git-dir ${git} add .`.quiet().cwd(Instance.directory).nothrow()
|
||||
const result = await $`git --git-dir=${git} diff ${hash} -- .`.quiet().cwd(Instance.worktree).nothrow()
|
||||
|
||||
if (result.exitCode !== 0) {
|
||||
|
||||
@@ -502,9 +502,9 @@ test("diff function with various changes", async () => {
|
||||
await Bun.write(`${tmp.path}/b.txt`, "modified content")
|
||||
|
||||
const diff = await Snapshot.diff(before!)
|
||||
expect(diff).toContain("deleted")
|
||||
expect(diff).toContain("modified")
|
||||
// Note: git diff only shows changes to tracked files, not untracked files like new.txt
|
||||
expect(diff).toContain("a.txt")
|
||||
expect(diff).toContain("b.txt")
|
||||
expect(diff).toContain("new.txt")
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user