refactor(reference): remove duplication

This commit is contained in:
Aleksey Kulikov 2021-08-09 11:56:37 +03:00
parent a474f06917
commit 1f0201d259
6 changed files with 147 additions and 208 deletions

View file

@ -4,7 +4,10 @@ import 'package:libgit2dart/libgit2dart.dart';
void main() {
final repo = Repository.open(Directory.current.path);
final ref = repo.getReference('refs/heads/master');
print('Repository references: ${Reference.list(repo)}');
final ref = Reference.get(repo, 'refs/heads/master');
print('Reference SHA hex: ${ref.target.sha}');
print('Is reference a local branch: ${ref.isBranch}');

View file

@ -11,7 +11,6 @@ void main() {
print('Is repository bare: ${repo.isBare}');
print('Is repository empty: ${repo.isEmpty}');
print('Is head detached: ${repo.isHeadDetached}');
print('Repository refs: ${repo.references}');
// free() should be called on object to free memory when done.
repo.free();