mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat(tag): add more bindings and api methods
This commit is contained in:
parent
0ed5e7c797
commit
c88b75b0fd
3 changed files with 72 additions and 0 deletions
|
@ -74,6 +74,13 @@ class Tag {
|
|||
return Oid(result);
|
||||
}
|
||||
|
||||
/// Returns a list with all the tags in the repository.
|
||||
///
|
||||
/// Throws a [LibGit2Error] if error occured.
|
||||
static List<String> list(Repository repo) {
|
||||
return bindings.list(repo.pointer);
|
||||
}
|
||||
|
||||
/// Get the tagged object (commit, tree, blob, tag) of a tag.
|
||||
///
|
||||
/// This method performs a repository lookup for the given object and returns it.
|
||||
|
@ -122,6 +129,16 @@ class Tag {
|
|||
}
|
||||
}
|
||||
|
||||
/// Deletes an existing tag reference.
|
||||
///
|
||||
/// The tag name will be checked for validity.
|
||||
///
|
||||
/// Throws a [LibGit2Error] if error occured.
|
||||
void delete() {
|
||||
final owner = bindings.owner(_tagPointer);
|
||||
bindings.delete(repoPointer: owner, tagName: name);
|
||||
}
|
||||
|
||||
/// Releases memory allocated for tag object.
|
||||
void free() => bindings.free(_tagPointer);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue