feat(reference): add ability to create direct reference

This commit is contained in:
Aleksey Kulikov 2021-08-05 19:48:58 +03:00
parent 6643527f2d
commit 9190ed2e0f
16 changed files with 669 additions and 60 deletions

View file

@ -4,11 +4,12 @@ import 'package:libgit2dart/libgit2dart.dart';
void main() {
final repo = Repository.open(Directory.current.path);
final ref = Reference.lookup(repo, 'refs/heads/master');
final ref = repo.getReference('refs/heads/master');
print('Reference SHA hex: ${ref.target}');
print('Reference SHA hex: ${ref.target.sha}');
print('Is reference a local branch: ${ref.isBranch}');
print('Reference full name: ${ref.name}');
ref.free();
repo.close();
}