mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-04 20:29:08 -04:00
refactor!: use Finalizer
to automatically free allocated memory for objects (#48)
BREAKING CHANGE: signature change for remote and repository callbacks during repository clone operation.
This commit is contained in:
parent
94c40f9a94
commit
a3213a88a2
103 changed files with 2278 additions and 2595 deletions
|
@ -24,7 +24,6 @@ void main() {
|
|||
});
|
||||
|
||||
tearDown(() {
|
||||
stasher.free();
|
||||
repo.free();
|
||||
tmpDir.deleteSync(recursive: true);
|
||||
});
|
||||
|
@ -62,14 +61,11 @@ void main() {
|
|||
|
||||
test('leaves changes added to index intact', () {
|
||||
File(filePath).writeAsStringSync('edit', mode: FileMode.append);
|
||||
final index = repo.index;
|
||||
index.add('file');
|
||||
repo.index.add('file');
|
||||
|
||||
Stash.create(repo: repo, stasher: stasher, flags: {GitStash.keepIndex});
|
||||
expect(repo.status.isEmpty, false);
|
||||
expect(repo.stashes.length, 1);
|
||||
|
||||
index.free();
|
||||
});
|
||||
|
||||
test('applies changes from stash', () {
|
||||
|
@ -109,8 +105,6 @@ void main() {
|
|||
Stash.apply(repo: repo, reinstateIndex: true);
|
||||
expect(repo.status, contains('stash.this'));
|
||||
expect(index.find('stash.this'), true);
|
||||
|
||||
index.free();
|
||||
});
|
||||
|
||||
test('throws when trying to apply with wrong index', () {
|
||||
|
@ -182,8 +176,6 @@ void main() {
|
|||
Stash.pop(repo: repo, reinstateIndex: true);
|
||||
expect(repo.status, contains('stash.this'));
|
||||
expect(index.find('stash.this'), true);
|
||||
|
||||
index.free();
|
||||
});
|
||||
|
||||
test('throws when trying to pop with wrong index', () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue