readBundle method
The directory-shaped bundle at locator, as a detached medium.
Implementation
@override
Future<TomBundleMedium> readBundle(String locator) async {
final loc = TomGitLocator.parse(locator);
final t = await _tip(locator, loc);
final tip = t.tip;
if (tip == null) throw TomContainerNotFoundException(locator);
final repo = t.endpoint.repo;
final entry = await repo.entryAt(
(await repo.readCommit(tip)).tree,
t.loc.path,
);
if (entry == null || !entry.isTree) {
throw TomContainerNotFoundException(locator);
}
return TomReadOnlyBundleMedium(_TreeMedium(repo, entry.id, locator));
}