text: public static boolean isGitRepository(File dir, FS fs) {return fs.resolve(dir, Constants.OBJECTS).exists()&& fs.resolve(dir, "refs").exists() && (fs.resolve(dir, Constants.REFTABLE).exists()|| isValidHead(new File(dir, Constants.HEAD)));}