isValidRepo static method
Implementation
static Future<bool> isValidRepo(String gitRootDir, {FileSystem? fs}) async {
fs ??= const LocalFileSystemWithChecks();
var isDir = await fs.isDirectory(gitRootDir);
if (!isDir) {
return false;
}
var repo = GitRepository._internal(rootDir: gitRootDir, fs: fs);
var dotGitExists = await fs.isDirectory(repo.gitDir);
if (!dotGitExists) {
return false;
}
var configPath = p.join(repo.gitDir, 'config');
if (!fs.isFileSync(configPath)) {
return false;
}
return true;
}