mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat(reference): add ability to peel reference until object of specified type is found
This commit is contained in:
parent
56713da648
commit
f63808b4f8
4 changed files with 91 additions and 0 deletions
|
@ -81,6 +81,13 @@ class Tag {
|
|||
///
|
||||
/// Returned object should be explicitly downcasted to one of four of git object types.
|
||||
///
|
||||
/// ```dart
|
||||
/// final commit = tag.target as Commit;
|
||||
/// final tree = tag.target as Tree;
|
||||
/// final blob = tag.target as Blob;
|
||||
/// final tag = tag.target as Tag;
|
||||
/// ```
|
||||
///
|
||||
/// Throws a [LibGit2Error] if error occured.
|
||||
Object get target {
|
||||
final type = bindings.targetType(_tagPointer);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue