mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat(reflog): add more bindings and API methods (#29)
This commit is contained in:
parent
ff2dd8b408
commit
fda5173e7f
5 changed files with 305 additions and 12 deletions
|
@ -139,6 +139,19 @@ class Reference {
|
|||
refdb_bindings.free(refdb);
|
||||
}
|
||||
|
||||
/// 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.
|
||||
static void ensureLog({
|
||||
required Repository repo,
|
||||
required String refName,
|
||||
}) {
|
||||
bindings.ensureLog(repoPointer: repo.pointer, refName: refName);
|
||||
}
|
||||
|
||||
/// Creates a copy of an existing reference.
|
||||
///
|
||||
/// **IMPORTANT**: Should be freed to release allocated memory.
|
||||
|
@ -247,17 +260,6 @@ 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