hooks: lock by hooks directory, not by repository

Commit

peyton-alt22h ago

The hooks lock lived in each repository's git common dir, but core.hooksPath can point several repositories at one hooks directory; they took different locks and could interleave installs and removals there. The lock now lives in the per-user cache, named from the resolved hooks directory, so every repository using a directory takes the same one. Temp names and the leftover sweep are safe under it unchanged.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com Entire-Checkpoint: 01M47DHMVBQFK9GG62AK1H1SSE

Checkpoints

Triaging Git Hooks Tickets and Adversarial Review

Claude CodeOpus 5.5
View session
Checkpoint 1