db350aae44
`git rev-parse --show-toplevel` in hook context (cwd=GIT_DIR, GIT_DIR set) returns the .git path itself without erroring, so the previous `|| echo $PWD` fallback never triggered and the script silently cd'd into .git/. Use `git rev-parse --absolute-git-dir` to reliably get the absolute git-dir, then its parent is the worktree root. This works in both interactive shells and hook context.