fix: install git hooks in linked worktrees (#4387) (#4722)

The prepare guard used `test -d .git`, which is false in a linked
worktree where .git is a file, so lefthook install was silently skipped.
Use `test -e .git` so clones and linked worktrees both install hooks
while non-git directories remain a no-op.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Poetry Of Code
2026-10-24 01:30:56 +00:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 7dd83b8513
commit 9ac16b4aa1
+1 -1
View File
@@ -63,7 +63,7 @@
"package:codex-plugin": "node scripts/package-codex-plugin.mjs",
"upload:docs-images": "bash scripts/upload-docs-images.sh",
"host:registry-assets": "bun run scripts/host-registry-assets.ts",
"prepare": "test -d .git && lefthook install || true",
"prepare": "test -e .git && lefthook install || true",
"lint:registry-items": "node scripts/lint-registry-items.mjs"
},
"dependencies": {