Use --show-toplevel instead of --git-dir to get correct repo path

This patch prevents an annoying error "fatal: '/home/user/repo/.git/modules' is outside repository " message anytime you cd into a submodule folder.