readIndex method

Future<GitIndex> readIndex()

Implementation

Future<GitIndex> readIndex() async {
  var file = fs.file(p.join(gitDir, 'index'));
  if (!file.existsSync()) {
    return GitIndex(versionNo: 2);
  }

  // FIXME: What if reading this file fails cause of permission issues?
  return GitIndex.decode(await file.readAsBytes());
}