Improve git directory verification