/usr/share/perl5/Git/PurePerl/NewObject.pm is in libgit-pureperl-perl 0.53-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | package Git::PurePerl::NewObject;
use Moose;
use MooseX::StrictConstructor;
use Moose::Util::TypeConstraints;
use namespace::autoclean;
enum 'ObjectKind' => [qw(commit tree blob tag)];
has 'kind' => ( is => 'ro', isa => 'ObjectKind', required => 1 );
has 'size' => ( is => 'ro', isa => 'Int', required => 0, lazy_build => 1 );
has 'content' => ( is => 'rw', isa => 'Str', required => 0, lazy_build => 1 );
has 'sha1' => ( is => 'ro', isa => 'Str', required => 0, lazy_build => 1 );
sub _build_sha1 {
my $self = shift;
my $sha1 = Digest::SHA->new;
$sha1->add( $self->raw );
my $sha1_hex = $sha1->hexdigest;
return $sha1_hex;
}
sub _build_size {
my $self = shift;
return length $self->content;
}
sub raw {
my $self = shift;
return $self->kind . ' ' . $self->size . "\0" . $self->content;
}
__PACKAGE__->meta->make_immutable;
|