mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-04 12:19:09 -04:00
feat(reference): add ability to create direct reference
This commit is contained in:
parent
6643527f2d
commit
9190ed2e0f
16 changed files with 669 additions and 60 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue