mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-04 20:29:08 -04:00
feat(repository)!: add more aliases for api methods
BREAKING CHANGE: Make repository entry point for most operations
This commit is contained in:
parent
9205a3ad82
commit
3a0fa75929
51 changed files with 1380 additions and 1062 deletions
|
@ -7,14 +7,14 @@ void main() {
|
|||
late Repository repo;
|
||||
late Directory tmpDir;
|
||||
|
||||
setUp(() async {
|
||||
tmpDir = await setupRepo(Directory('test/assets/testrepo/'));
|
||||
setUp(() {
|
||||
tmpDir = setupRepo(Directory('test/assets/testrepo/'));
|
||||
repo = Repository.open(tmpDir.path);
|
||||
});
|
||||
|
||||
tearDown(() async {
|
||||
tearDown(() {
|
||||
repo.free();
|
||||
await tmpDir.delete(recursive: true);
|
||||
tmpDir.deleteSync(recursive: true);
|
||||
});
|
||||
|
||||
group('PackBuilder', () {
|
||||
|
@ -86,12 +86,14 @@ void main() {
|
|||
|
||||
test('successfully packs with provided packDelegate', () {
|
||||
void packDelegate(PackBuilder packBuilder) {
|
||||
for (var branchName in repo.branches.list()) {
|
||||
final branch = repo.references['refs/heads/$branchName'];
|
||||
for (var commit in repo.log(sha: branch.target.sha)) {
|
||||
final branches = repo.branches;
|
||||
for (var branch in branches) {
|
||||
final ref = repo.lookupReference('refs/heads/${branch.name}');
|
||||
for (var commit in repo.log(sha: ref.target.sha)) {
|
||||
packBuilder.addRecursively(commit.id);
|
||||
commit.free();
|
||||
}
|
||||
ref.free();
|
||||
branch.free();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue