| 1 | # ABSTRACT: A libgit2 annotated tag | ||
| 2 | |||
| 3 | package Git::Native::Tag; | ||
| 4 | our $VERSION = '0.006'; | ||
| 5 | use Moo; | ||
| 6 | use Git::Libgit2::FFI (); | ||
| 7 | use Git::Native::Error qw( check_rc ); | ||
| 8 | use Git::Native::Oid (); | ||
| 9 | |||
| 10 | has _handle => ( is => 'ro', required => 1 ); # git_tag* | ||
| 11 | has _owner => ( is => 'ro', required => 1 ); | ||
| 12 | |||
| 13 | sub name { Git::Libgit2::FFI::git_tag_name( $_[0]->_handle ) } | ||
| 14 | sub message { Git::Libgit2::FFI::git_tag_message( $_[0]->_handle ) } | ||
| 15 | |||
| 16 | sub target_id { | ||
| 17 | my $self = shift; | ||
| 18 | my $oidp = Git::Libgit2::FFI::git_tag_target_id( $self->_handle ); | ||
| 19 | return Git::Native::Oid->from_ptr($oidp); | ||
| 20 | } | ||
| 21 | |||
| 22 | sub DEMOLISH { | ||
| 23 | my $self = shift; | ||
| 24 | Git::Libgit2::FFI::git_tag_free( $self->{_handle} ) if $self->{_handle}; | ||
| 25 | } | ||
| 26 | |||
| 27 | 1; | ||
| 28 | |||
| 29 | __END__ |