refactor: pass repository object to arguments instead of pointer

This commit is contained in:
Aleksey Kulikov 2021-08-30 17:14:52 +03:00
parent 94b4116adf
commit e0e3742457
6 changed files with 45 additions and 26 deletions

View file

@ -18,13 +18,13 @@ class Commit {
libgit2.git_libgit2_init();
}
/// Initializes a new instance of [Commit] class from provided pointer to [Repository]
/// object in memory and pointer to [Oid] object in memory.
/// Initializes a new instance of [Commit] class from provided [Repository]
/// and [Oid] objects.
///
/// Should be freed with `free()` to release allocated memory.
Commit.lookup(Pointer<git_repository> repo, Pointer<git_oid> oid) {
Commit.lookup(Repository repo, Oid oid) {
libgit2.git_libgit2_init();
_commitPointer = bindings.lookup(repo, oid);
_commitPointer = bindings.lookup(repo.pointer, oid.pointer);
}
/// Pointer to memory address for allocated commit object.