feat(commit): add base bindings and api

This commit is contained in:
Aleksey Kulikov 2021-08-24 19:08:12 +03:00
parent 696d55bb3a
commit dc5f510aa5
12 changed files with 485 additions and 17 deletions

View file

@ -4,11 +4,17 @@ import 'bindings/tree.dart' as bindings;
import 'util.dart';
class Tree {
/// Initializes a new instance of [Tree] class from provided
/// pointer to tree object in memory.
Tree(this._treePointer) {
libgit2.git_libgit2_init();
}
/// Initializes a new instance of [Tree] class from provided
/// pointers to repository object and oid object in memory.
///
/// Should be freed with `free()` to release allocated memory.
Tree(Pointer<git_repository> repo, Pointer<git_oid> id) {
Tree.lookup(Pointer<git_repository> repo, Pointer<git_oid> id) {
libgit2.git_libgit2_init();
_treePointer = bindings.lookup(repo, id);
}