mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-04 20:29:08 -04:00
refactor(reference): remove duplication
This commit is contained in:
parent
a474f06917
commit
1f0201d259
6 changed files with 147 additions and 208 deletions
|
@ -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}');
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue