public boolean isValidGitRepository ( Path folder ) { if ( Files . exists ( folder ) && Files . isDirectory ( folder ) ) { // If it has been at least initialized if ( RepositoryCache . FileKey . isGitRepository ( folder . toFile ( ) , FS . DETECTED ) ) { // we are assuming that the clone worked at that time, caller should call hasAtLeastOneReference return true ; } else { return false ; } } else { return false ; } }
Checks if given folder is a git repository