-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Current Behavior
The pre-commit, pre-push hooks and perf-validate command hardcode .git/perf-attestation.json and .git/hooks/ paths. In a git worktree, .git is a file (pointer to the real git dir), not a directory. This causes:
cargo xtask perf-validatefails to write attestation:Not a directory (os error 20)- Pre-push hook can't find the attestation and blocks the push
cargo xtask install-hookswould fail in a worktree
Expected Behavior
Hooks and attestation should work correctly in both normal repos and git worktrees.
Technical Details
Relevant Code
xtask/src/hooks.rs:54,85,118 and xtask/src/perf_validate.rs:246
All use root.join(".git/...") which assumes .git is a directory.
Root Cause
In a git worktree, .git is a file containing gitdir: /path/to/real/.git/worktrees/<name>. The fix is to use git rev-parse --git-dir which returns the correct directory in both contexts.
Reactions are currently unavailable