mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
test: remove unnecessary variables declarations
This commit is contained in:
parent
76b8de1f80
commit
28f08e308a
23 changed files with 416 additions and 492 deletions
|
@ -25,33 +25,27 @@ void main() {
|
|||
|
||||
group('Reset', () {
|
||||
test('resets with hard', () {
|
||||
var contents = file.readAsStringSync();
|
||||
expect(contents, 'Feature edit\n');
|
||||
expect(file.readAsStringSync(), 'Feature edit\n');
|
||||
|
||||
repo.reset(oid: repo[sha], resetType: GitReset.hard);
|
||||
contents = file.readAsStringSync();
|
||||
expect(contents, isEmpty);
|
||||
expect(file.readAsStringSync(), isEmpty);
|
||||
});
|
||||
|
||||
test('resets with soft', () {
|
||||
var contents = file.readAsStringSync();
|
||||
expect(contents, 'Feature edit\n');
|
||||
expect(file.readAsStringSync(), 'Feature edit\n');
|
||||
|
||||
repo.reset(oid: repo[sha], resetType: GitReset.soft);
|
||||
contents = file.readAsStringSync();
|
||||
expect(contents, 'Feature edit\n');
|
||||
expect(file.readAsStringSync(), 'Feature edit\n');
|
||||
|
||||
final diff = Diff.indexToWorkdir(repo: repo, index: repo.index);
|
||||
expect(diff.deltas, isEmpty);
|
||||
});
|
||||
|
||||
test('resets with mixed', () {
|
||||
var contents = file.readAsStringSync();
|
||||
expect(contents, 'Feature edit\n');
|
||||
expect(file.readAsStringSync(), 'Feature edit\n');
|
||||
|
||||
repo.reset(oid: repo[sha], resetType: GitReset.mixed);
|
||||
contents = file.readAsStringSync();
|
||||
expect(contents, 'Feature edit\n');
|
||||
expect(file.readAsStringSync(), 'Feature edit\n');
|
||||
|
||||
final diff = Diff.indexToWorkdir(repo: repo, index: repo.index);
|
||||
expect(diff.deltas.length, 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue