You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hook dispatcher breaks on Git for Windows when core.hooksPath is an absolute path #3102
Some tools set an absolute path on purpose. For example, worktree managers point linked worktrees at the main checkout's dispatcher, because the generated .vite-hooks/_ is gitignored and missing in a new worktree.
Cause
The generated .vite-hooks/_/h derives the repo root from $0 and prepends it to PATH:
Git for Windows passes $0 as a drive-letter path, so d is C:\repo or C:/repo. sh splits the PATH entry at the drive colon into C and \repo\node_modules\.bin:
With backslashes, sh finds the pnpm shim through the drive-relative path. The shim then passes /repo/... to Node, which MSYS maps under the Git install root, giving the MODULE_NOT_FOUND above.
With forward slashes, the entry doesn't resolve, and vp silently falls back to whatever else is on PATH (here, the global ~/.vite-plus/bin/vp).
Repro
On Windows with Git for Windows, run vp config --hooks in a repo whose pre-commit is vp staged.
Run git config core.hooksPath "$(pwd -W)\.vite-hooks\_", or any C:\... absolute value.
Run git commit.
Suggested fix
Normalise d (or $0) to a POSIX path before building PATH, for example:
Activity