From ab9b237c5811fb2dd2c8d4c331709159e7e7f005 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 10 Aug 2026 07:36:23 +0000 Subject: [PATCH] fix(scripts): re-spell check-changeset-no-major's older R control through renameRow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- scripts/check-changeset-no-major.mjs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/check-changeset-no-major.mjs b/scripts/check-changeset-no-major.mjs index df5d0d4cb5..230e18b204 100644 --- a/scripts/check-changeset-no-major.mjs +++ b/scripts/check-changeset-no-major.mjs @@ -1078,10 +1078,9 @@ function selfTest() { const oldMinor = '---\n"@objectstack/spec": minor\n---' + long; const newMajor = '---\n"@objectstack/spec": major\n---' + long; const { dir, base } = makeRepo({ '.changeset/old.md': oldMinor }, { '.changeset/old.md': null, '.changeset/new.md': newMajor }); - const raw = git(['diff', '--name-status', base, 'HEAD', '--', '.changeset/*.md'], dir); assert( - /^R\d/.test(raw.trim()), - `control: git must really report this as a rename, or the row below is about an ordinary add — got ${JSON.stringify(raw.trim())}`, + renameRow(dir, base, '\\.changeset/old\\.md', '\\.changeset/new\\.md') !== null, + `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))}`, ); const { introduced } = scan({ cwd: dir, base }); assert(