mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-04 20:29:08 -04:00
feat(checkout): add ability to dry run checkout
This commit is contained in:
parent
75b9ed6b57
commit
101cf90875
2 changed files with 21 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
import 'dart:io';
|
||||
import 'package:libgit2dart/src/git_types.dart';
|
||||
import 'package:test/test.dart';
|
||||
import 'package:libgit2dart/libgit2dart.dart';
|
||||
import 'helpers/util.dart';
|
||||
|
@ -93,5 +94,20 @@ void main() {
|
|||
},
|
||||
);
|
||||
});
|
||||
|
||||
test('successfully performs dry run checkout', () {
|
||||
final index = repo.index;
|
||||
expect(index.length, 4);
|
||||
expect(File('${repo.workdir}/another_feature_file').existsSync(), false);
|
||||
|
||||
repo.checkout(
|
||||
refName: 'refs/heads/feature',
|
||||
strategy: {GitCheckout.dryRun},
|
||||
);
|
||||
expect(index.length, 4);
|
||||
expect(File('${repo.workdir}/another_feature_file').existsSync(), false);
|
||||
|
||||
index.free();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue