refactor(remote)!: add RemoteReference class

BREAKING CHANGE: Return value of ls(...) changed from List<Map<String, Object?>> to List<RemoteReference>
This commit is contained in:
Aleksey Kulikov 2022-04-29 15:15:26 +03:00
parent 6d1ccd5c12
commit df9029485e
2 changed files with 54 additions and 18 deletions

View file

@ -265,14 +265,12 @@ void main() {
final remote = Remote.lookup(repo: repo, name: 'libgit2');
final refs = remote.ls();
expect(refs.first['local'], false);
expect(refs.first['loid'], null);
expect(refs.first['name'], 'HEAD');
expect(refs.first['symref'], 'refs/heads/master');
expect(
(refs.first['oid']! as Oid).sha,
'49322bb17d3acc9146f98c97d078513228bbf3c0',
);
expect(refs.first.isLocal, false);
expect(refs.first.localId, null);
expect(refs.first.name, 'HEAD');
expect(refs.first.symRef, 'refs/heads/master');
expect((refs.first.oid).sha, '49322bb17d3acc9146f98c97d078513228bbf3c0');
expect(refs.first.toString(), contains('RemoteReference{'));
});
test(