3b1ab0fc1b
The $0-based dirname trick didn't work because git invokes hooks with just the basename (e.g., 'post-receive'), not the absolute path. Use 'git rev-parse --absolute-git-dir' instead, which works even when CWD is inside .git/.