Skip to content

fix: set core.hookspath in prepare script to override global config#294

Merged
cs01 merged 1 commit intomainfrom
add-precommit-hook
Mar 12, 2026
Merged

fix: set core.hookspath in prepare script to override global config#294
cs01 merged 1 commit intomainfrom
add-precommit-hook

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Mar 12, 2026

Summary

  • The prepare script now sets git config core.hooksPath .git/hooks before copying the pre-commit hook
  • Fixes: global core.hooksPath (e.g. from a previous husky install) silently overrides the repo's hook directory, so npm install installs the hook but git never runs it
  • The pre-commit hook auto-formats staged .ts/.js files with prettier — prevents format-check CI failures

Test plan

  • npm run prepare succeeds and installs hook
  • Commits from worktrees trigger the pre-commit hook

🤖 Generated with Claude Code

@cs01 cs01 merged commit 8924f73 into main Mar 12, 2026
12 checks passed
@cs01 cs01 deleted the add-precommit-hook branch March 12, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant