mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat(reference): add more bindings and API methods (#28)
This commit is contained in:
parent
fb4694cf06
commit
ff2dd8b408
3 changed files with 55 additions and 0 deletions
|
@ -139,6 +139,11 @@ class Reference {
|
|||
refdb_bindings.free(refdb);
|
||||
}
|
||||
|
||||
/// Creates a copy of an existing reference.
|
||||
///
|
||||
/// **IMPORTANT**: Should be freed to release allocated memory.
|
||||
Reference duplicate() => Reference(bindings.duplicate(_refPointer));
|
||||
|
||||
/// Type of the reference.
|
||||
ReferenceType get type {
|
||||
return bindings.referenceType(_refPointer) == 1
|
||||
|
@ -242,6 +247,17 @@ class Reference {
|
|||
);
|
||||
}
|
||||
|
||||
/// Ensures there is a reflog for a particular reference.
|
||||
///
|
||||
/// Makes sure that successive updates to the reference will append to its
|
||||
/// log.
|
||||
///
|
||||
/// Throws a [LibGit2Error] if error occured.
|
||||
void ensureLog() {
|
||||
final owner = bindings.owner(_refPointer);
|
||||
bindings.ensureLog(repoPointer: owner, refName: name);
|
||||
}
|
||||
|
||||
/// [RefLog] object.
|
||||
///
|
||||
/// **IMPORTANT**: Should be freed to release allocated memory.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue