Fix path detection for commit hook