addDirectoryToIndex method
Implementation
Future<void> addDirectoryToIndex(GitIndex index, String dirPath,
{bool recursive = false}) async {
dirPath = normalizePath(dirPath);
var dir = fs.directory(dirPath);
await for (var fsEntity
in dir.list(recursive: recursive, followLinks: false)) {
if (fsEntity.path.startsWith(gitDir)) {
continue;
}
var stat = await fsEntity.stat();
if (stat.type != FileSystemEntityType.file) {
continue;
}
await addFileToIndex(index, fsEntity.path);
}
}