ci: fixes

This commit is contained in:
Dax Raad
2025-10-11 00:24:35 -04:00
parent 44b63dc259
commit 9d30bc692c
3 changed files with 5 additions and 3 deletions

View File

@@ -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(

View File

@@ -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) {

View File

@@ -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")
},
})
})