As others commented, this only acts when the first word in your commandline ends with '.git'.
- "git", alone isn't going to be hooked.
- you can do "cd .git".
- even if you have 'autocd' option set, you can '.git' and it will do "cd .git".
I'm not saying it's even a good practice, but I find it kinda cool, when using this feature in a way it's probably not intended for, you start thinking in 'what might happen inside'.