mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat(repository): add base bindings and api
This commit is contained in:
parent
39e2676055
commit
4bd324a596
50 changed files with 2250 additions and 47 deletions
|
@ -3,6 +3,23 @@ import 'dart:io';
|
|||
import 'package:libgit2dart/libgit2dart.dart';
|
||||
|
||||
void main() {
|
||||
final repo = Repository.open(Directory.current.path);
|
||||
print('Path to git repository: ${repo.path}');
|
||||
// Open repository
|
||||
try {
|
||||
final repo = Repository.open(Directory.current.path);
|
||||
|
||||
print('Path to git repository: ${repo.path()}');
|
||||
print('Is repository bare: ${repo.isBare()}');
|
||||
print('Is repository empty: ${repo.isEmpty()}');
|
||||
print('Is head detached: ${repo.isHeadDetached()}');
|
||||
try {
|
||||
print('Prepared message: ${repo.message()}');
|
||||
} catch (e) {
|
||||
print('Prepared message: $e');
|
||||
}
|
||||
|
||||
// close() should be called on object to free memory when done.
|
||||
repo.close();
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue