bytesAt method

Uint8List? bytesAt(
  1. String slug,
  2. String path, {
  3. String branch = 'main',
})

The bytes at path on branch, or null. The general accessor: a repository holds encrypted containers as readily as YAML.

Implementation

Uint8List? bytesAt(String slug, String path, {String branch = 'main'}) {
  final commit = repos[slug]?.refs['heads/$branch'];
  if (commit == null) return null;
  final sha = trees[commits[commit]!.treeSha]![path];
  return sha == null ? null : blobs[sha];
}