refactor(reference): simplify api

This commit is contained in:
Aleksey Kulikov 2021-09-23 17:05:28 +03:00
parent 466f960c7b
commit 3c1a6b4ab4
6 changed files with 113 additions and 191 deletions

View file

@ -9,7 +9,7 @@ void main() async {
final repo = Repository.open(tmpDir.path);
// Get list of repo's references.
print('Repository references: ${repo.references.list()}');
print('Repository references: ${repo.references.list}');
// Get reference by name.
final ref = repo.references['refs/heads/master'];
@ -20,7 +20,7 @@ void main() async {
print('Reference shorthand name: ${ref.shorthand}');
// Create new reference (direct or symbolic).
final newRef = repo.createReference(
final newRef = repo.references.create(
name: 'refs/tags/v1',
target: 'refs/heads/master',
);