mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 12:49:08 -04:00
feat(annotated)!: add more bindings and API methods (#26)
This commit is contained in:
parent
0176b66ba7
commit
fe570a6990
13 changed files with 498 additions and 146 deletions
|
@ -292,31 +292,3 @@ class Commit {
|
|||
' author: $author}';
|
||||
}
|
||||
}
|
||||
|
||||
/// An annotated commit contains information about how it was looked up, which
|
||||
/// may be useful for functions like merge or rebase to provide context to the
|
||||
/// operation. For example, conflict files will include the name of the source
|
||||
/// or target branches being merged.
|
||||
///
|
||||
/// Note: for internal use.
|
||||
class AnnotatedCommit {
|
||||
/// Lookups an annotated commit from the given commit [oid].
|
||||
///
|
||||
/// **IMPORTANT**: Should be freed to release allocated memory.
|
||||
///
|
||||
/// Throws a [LibGit2Error] if error occured.
|
||||
AnnotatedCommit.lookup({required Repository repo, required Oid oid}) {
|
||||
_annotatedCommitPointer = bindings.annotatedLookup(
|
||||
repoPointer: repo.pointer,
|
||||
oidPointer: oid.pointer,
|
||||
);
|
||||
}
|
||||
|
||||
late final Pointer<Pointer<git_annotated_commit>> _annotatedCommitPointer;
|
||||
|
||||
/// Pointer to pointer to memory address for allocated commit object.
|
||||
Pointer<Pointer<git_annotated_commit>> get pointer => _annotatedCommitPointer;
|
||||
|
||||
/// Releases memory allocated for commit object.
|
||||
void free() => bindings.annotatedFree(_annotatedCommitPointer.value);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue