`dirsAreEqual` compared the result of `path.relative()` with `'.'`, but
Node returns `''` for equal paths, so both equality checks in
`storePathRelativeToHome` were always false. The dead branch would have
placed the store in the home directory whenever the project folder was
the only linkable location.
Executing that branch would be the wrong trade. It fires exactly when no
ancestor of the project accepts a hard link — an agent sandbox that
grants write access only to the project, or a container with just the
project bind-mounted writable. There the home store is either read-only,
so the install fails outright, or on another volume, so every package is
copied instead of hard linked and nothing is ever reused. A store on the
project's own volume is the better answer in both cases, so the branch is
removed rather than repaired, and the surviving root guard drops the
helper for a plain string comparison of two `path.join` results.
pacquet implemented the intended-but-dead branch, so it inherited both
failure modes; it now keeps the store in the project too. It places the
store at `<project>/node_modules/.pnpm-store` instead of pnpm 11's
`<project>/.pnpm-store`, which keeps it out of the working tree's VCS
status. The install purge already skips hidden entries other than `.bin`,
`.modules.yaml`, and the virtual store dir, so a layout change cannot
wipe the store; `test_install_purges_node_modules_on_layout_mismatch` now
pins that.
Closespnpm/pnpm#13525