mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-04 20:29:08 -04:00
18 lines
436 B
Dart
18 lines
436 B
Dart
import 'dart:io';
|
|
|
|
import 'package:libgit2dart/libgit2dart.dart';
|
|
|
|
void main() {
|
|
final repo = Repository.open(Directory.current.path);
|
|
|
|
print('Repository references: ${repo.references.list()}');
|
|
|
|
final ref = repo.references['refs/heads/master'];
|
|
|
|
print('Reference SHA hex: ${ref.target.sha}');
|
|
print('Is reference a local branch: ${ref.isBranch}');
|
|
print('Reference full name: ${ref.name}');
|
|
|
|
ref.free();
|
|
repo.free();
|
|
}
|