Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 12 additions & 1 deletion tools/version-guard/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,18 @@ export async function cutGoldenChanges(
lastTag: string,
sha: string,
): Promise<GoldenChange[]> {
await fx.run("git", ["fetch", "origin", `refs/tags/${lastTag}`, "--depth=1"]);
// The full-refspec form is load-bearing: without a DESTINATION
// (`:refs/tags/…`) the fetch drops the objects into FETCH_HEAD but
// creates no local ref, so the tag NAME stays unresolvable and the diff
// below fails with "bad revision" (the v0.5.0 cut, first dispatch). The
// PR-base fetch this mirrors gets away with a bare source because a raw
// sha resolves from the object store alone; a tag name needs a ref.
await fx.run("git", [
"fetch",
"origin",
`+refs/tags/${lastTag}:refs/tags/${lastTag}`,
"--depth=1",
]);
let diff = await fx.run("git", [
"diff",
"--name-status",
Expand Down
4 changes: 2 additions & 2 deletions tools/version-guard/check_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ Deno.test("cut: end to end — window scan, guards, and the notes fragment", asy
}),
},
git: {
"fetch origin refs/tags/v0.4.0 --depth=1": {},
"fetch origin +refs/tags/v0.4.0:refs/tags/v0.4.0 --depth=1": {},
"diff --name-status v0.4.0..cut12345 -- runtime/tests/conventions/golden/":
{ stdout: "" },
},
Expand Down Expand Up @@ -797,7 +797,7 @@ function cutFake(over: {
}),
},
git: {
"fetch origin refs/tags/v0.4.0 --depth=1": {},
"fetch origin +refs/tags/v0.4.0:refs/tags/v0.4.0 --depth=1": {},
"diff --name-status v0.4.0..cut12345 -- runtime/tests/conventions/golden/":
{ stdout: over.goldenDiff ?? "" },
},
Expand Down
Loading