fix(verification): the done line and the release check take only full commit ids

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-10-26 13:33:51 +01:00
commit e279f12131
Signed by: ktg
SSH key fingerprint: SHA256:JakMjO6FTBBzN0Bhfj9saOoEjaFxlSdYuZQQpM/lF9Q
4 changed files with 73 additions and 8 deletions

View file

@ -536,3 +536,21 @@ test('release-check r9 / bdd46799 — one review.md reached through a symlinked
assert.equal(r.status, 0, r.stdout + r.stderr);
} finally { rmSync(link, { force: true }); fx.cleanup(); }
});
// ==== fix round 4.5b: only a full 40- or 64-hex commit id (M11 sibling) ======
test('[M11] sibling: the release check refuses a 64-hex branch name in a SHA-1 repository with the reason "(a full 40- or 64-hex commit id)"', () => {
// In a SHA-1 repository a 64-hex name is no object id; git resolves it as a
// ref name to wherever the branch points, so coverage would pass a review
// of whatever the branch is moved to.
const name = 'c0ffee'.padEnd(64, '0');
const fx = fixture({ reviewSha: name });
try {
git(fx.repo, 'branch', name, 'HEAD~1');
const r = run(fx, ['--json']);
assert.equal(r.status, 1, r.stdout + r.stderr);
const coverage = JSON.parse(r.stdout).checks.find((c) => c.id === 'coverage');
assert.equal(coverage.status, 'fail', JSON.stringify(coverage));
assert.ok(coverage.detail.includes('(a full 40- or 64-hex commit id)'), `the reason names a full commit id: ${coverage.detail}`);
} finally { fx.cleanup(); }
});