findRootDir static method
Implementation
static String? findRootDir(String path, {FileSystem? fs}) {
fs ??= const LocalFileSystemWithChecks();
while (true) {
var gitDir = p.join(path, '.git');
if (fs.isDirectorySync(gitDir)) {
return path;
}
if (path == p.separator) {
break;
}
path = p.dirname(path);
}
return null;
}