mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat(odb): add more bindings and api methods
This commit is contained in:
parent
2ce419d7c4
commit
618b4e7f05
5 changed files with 416 additions and 14 deletions
|
@ -84,3 +84,17 @@ int compare({
|
|||
}) {
|
||||
return libgit2.git_oid_cmp(aPointer, bPointer);
|
||||
}
|
||||
|
||||
/// Copy an oid from one structure to another.
|
||||
///
|
||||
/// Throws a [LibGit2Error] if error occured.
|
||||
Pointer<git_oid> copy(Pointer<git_oid> src) {
|
||||
final out = calloc<git_oid>();
|
||||
final error = libgit2.git_oid_cpy(out, src);
|
||||
|
||||
if (error < 0) {
|
||||
throw LibGit2Error(libgit2.git_error_last());
|
||||
} else {
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue