Skip to content

Commit 123ea2f

Browse files
committed
test(server): create ref snapshot fixtures through git
Made with GPT-6.1 Sol via Codex in T3 Code.
1 parent 72763d6 commit 123ea2f

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

‎apps/server/src/vcs/GitVcsDriverCore.test.ts‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3513,16 +3513,19 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => {
35133513
assert.notEqual(yield* snapshot, fetched);
35143514

35153515
const head = yield* git(cwd, ["rev-parse", "HEAD"]);
3516-
yield* writeTextFile(
3516+
yield* driver.execute({
3517+
operation: "GitVcsDriver.test.git",
35173518
cwd,
3518-
".git/packed-refs",
3519-
Array.from(
3519+
args: ["update-ref", "--stdin"],
3520+
stdin: Array.from(
35203521
{ length: 16_000 },
3521-
(_, index) => `${head.trim()} refs/heads/snapshot-${String(index).padStart(5, "0")}\n`,
3522+
(_, index) => `create refs/heads/snapshot-${String(index).padStart(5, "0")} ${head}\n`,
35223523
).join(""),
3523-
);
3524+
});
3525+
yield* git(cwd, ["pack-refs", "--all"]);
35243526
const large = yield* snapshot;
35253527
assert.isNotNull(large);
3528+
assert.isAbove(Buffer.byteLength(large ?? "", "utf8"), 1_000_000);
35263529
assert.equal(yield* snapshot, large);
35273530
yield* git(cwd, ["update-ref", "refs/heads/snapshot-00000", "HEAD~1"]);
35283531
assert.notEqual(yield* snapshot, large);

0 commit comments

Comments
 (0)