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:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user