refactor(repository)!: use Finalizer to automatically free allocated memory (#51)

BREAKING CHANGE: Return value of identity getter changed from Map<String, String> to Identity
This commit is contained in:
Aleksey Kulikov 2022-05-02 15:33:31 +03:00 committed by GitHub
parent aef440e345
commit 4e55d0f06c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 109 additions and 151 deletions

View file

@ -18,7 +18,6 @@ void main() {
});
tearDown(() {
repo.free();
tmpDir.deleteSync(recursive: true);
});
@ -474,13 +473,8 @@ Total 69 (delta 0), reused 1 (delta 0), pack-reused 68
);
test('pushes with update reference callback', () {
final originDir =
Directory(p.join(Directory.systemTemp.path, 'origin_testrepo'));
final originDir = Directory.systemTemp.createTempSync('origin');
if (originDir.existsSync()) {
originDir.deleteSync(recursive: true);
}
originDir.createSync();
copyRepo(
from: Directory(p.join('test', 'assets', 'empty_bare.git')),
to: originDir,
@ -505,8 +499,9 @@ Total 69 (delta 0), reused 1 (delta 0), pack-reused 68
);
expect(updateRefOutput, {'refs/heads/master': ''});
originRepo.free();
originDir.delete(recursive: true);
if (Platform.isLinux || Platform.isMacOS) {
originDir.deleteSync(recursive: true);
}
});
test('throws when trying to push to invalid url', () {