Merge pull request #1266 from gsd-build/fix/stale-hook-check-path-1249

fix: stale hook detection checks wrong directory path
This commit is contained in:
Tom Boucher
2026-03-20 16:32:08 -04:00
committed by GitHub
4 changed files with 61 additions and 1 deletions

View File

@@ -968,6 +968,26 @@ describe('stale hook filter', () => {
});
});
// ─── stale hook path regression (#1249) ──────────────────────────────────────
describe('stale hook path', () => {
test('gsd-check-update.js checks get-shit-done/hooks/ not configDir/hooks/', () => {
const content = fs.readFileSync(
path.join(__dirname, '..', 'hooks', 'gsd-check-update.js'), 'utf-8'
);
assert.ok(
content.includes("path.join(configDir, 'get-shit-done', 'hooks')"),
'stale hook check must look in configDir/get-shit-done/hooks/, not configDir/hooks/'
);
assert.ok(
!content.includes("path.join(configDir, 'hooks')") ||
content.indexOf("path.join(configDir, 'get-shit-done', 'hooks')") <
content.indexOf("path.join(configDir, 'hooks')") + 100, // allow the old pattern only if corrected version exists first
'should not use the wrong hooks path'
);
});
});
// ─── resolveWorktreeRoot ─────────────────────────────────────────────────────
describe('resolveWorktreeRoot', () => {