Optimized check for .gitmodules