Skip to content

Commit ab9b237

Browse files
committed
fix(scripts): re-spell check-changeset-no-major's older R control through renameRow
Fixes #7164 The rename-row control PR #7048 added asserted only /^R\d/.test(raw.trim()) — that the diff output begins with an R row, not which two paths git paired. PR #7157 brought the family's renameRow helper (whole-row match, pinning both paths) into this file for its own case; this control was the one spelling left behind. Re-spelled through renameRow(dir, base, '.changeset/old.md', '.changeset/new.md'), matching the shape check-empty-changeset.mjs and check-adr-0087-registration.mjs already use, and removed the now-unused raw binding. No behaviour change.
1 parent f3f855a commit ab9b237

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

scripts/check-changeset-no-major.mjs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,10 +1078,9 @@ function selfTest() {
10781078
const oldMinor = '---\n"@objectstack/spec": minor\n---' + long;
10791079
const newMajor = '---\n"@objectstack/spec": major\n---' + long;
10801080
const { dir, base } = makeRepo({ '.changeset/old.md': oldMinor }, { '.changeset/old.md': null, '.changeset/new.md': newMajor });
1081-
const raw = git(['diff', '--name-status', base, 'HEAD', '--', '.changeset/*.md'], dir);
10821081
assert(
1083-
/^R\d/.test(raw.trim()),
1084-
`control: git must really report this as a rename, or the row below is about an ordinary add — got ${JSON.stringify(raw.trim())}`,
1082+
renameRow(dir, base, '\\.changeset/old\\.md', '\\.changeset/new\\.md') !== null,
1083+
`control: git must really pair .changeset/old.md with .changeset/new.md as a rename, or the row below is about an ordinary add — got ${JSON.stringify(git(['diff', '--name-status', base, 'HEAD', '--', '.changeset/*.md'], dir))}`,
10851084
);
10861085
const { introduced } = scan({ cwd: dir, base });
10871086
assert(

0 commit comments

Comments
 (0)