[version] Fix when .git not found