mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
refactor(reference): simplify api
This commit is contained in:
parent
466f960c7b
commit
3c1a6b4ab4
6 changed files with 113 additions and 191 deletions
|
@ -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',
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue